【发布时间】:2019-09-20 18:21:10
【问题描述】:
我想在我的 Fragment 中有一个带圆角的 ImageView。 我有以下 Kotlin 代码:
val imageView: ImageView = root.findViewById(R.id.profile_view)
val pv = RoundedBitmapDrawableFactory.create(res, src)
pv.setCornerRadius = 0f
imageView.setImageDrawable(pv)
create 和 res 在 Android Stuido 中带有红色下划线。 创建说:
以下函数都不能被以下函数调用 提供的参数: - 位图? - 输入流 - 字符串
res 说:
需要表达式,但找到了包名。
希望有人能帮我解决这个问题。
问候,杰里米
【问题讨论】:
-
请查看 [stackoverflow.com/questions/2459916/….我认为这样,您的问题将得到解决
-
并非如此。我会对 Kotlin 解决方案感到高兴。
标签: android android-studio kotlin imageview rounded-corners