我想放大视频。这是目前的实现
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/videoView"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<VideoView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:nextFocusRight="@id/home"
android:nextFocusLeft="@id/closed_captions"
android:nextFocusUp="@id/home"
android:nextFocusDown="@id/closed_captions" />
</RelativeLayout>
// reset zoom
videoView.setScaleX(2f)
videoView.setScaleY(2f)
这在一个设备上工作,但在另一个 android 设备上不工作。所以我不确定这里是否有问题..或者有其他选择吗?
请发布您的线路正在使用的设备
VideoView
扩展了 SurfaceView
,这是 View
的“特例”,无法设置动画。和方法改变,例如缩放、旋转、alpha 等。这是常见问题,THIS SO 中的更多信息以及搜索引擎中的更多资源
对于这样的动画(更改“外观属性”),您需要使用一些可播放视频的
View
,它扩展了TextureView