findViewById带有PhotoView库问题

时间:2019-05-13 14:03:34

标签: android kotlin android-photoview

我正试图在Kotlin中使用PhotoView library

但是当我尝试获取例如photoView时:

val photoView = mView.findViewById<PhotoView>(R.id.zoomImageView)

我收到错误消息“类型参数不在其范围内。 预期: 视图! 发现: PhotoView”

2 个答案:

答案 0 :(得分:2)

如果您遇到类型转换问题,请删除该类型转换或执行以下操作:

有两种方法可以解决此问题:

1)UIImageView

2)stamp = 0; state = pause; switch (state) { case play: play_ video(stamp); if (COMFORT CLOSE PUSH){ stamp = getStamp(video); state = pause; } else if (COMFORT OPEN){ state = revplay; } break; case pause: pause_ video; if(COMFORT OPEN){ state = revplay; } else if (COMFORT CLOSE){ state = play; } break; case revplay: revplay_ video(stamp); if(COMFORT CLOSE){ state = play; } if(COMFORT OPEN SWIPE){ stamp = getStamp(video); state = pause; } break; default: }

答案 1 :(得分:-1)

您可以用作

val photoView: PhotoView = mView.findViewById<PhotoView>(R.id.zoomImageView)