use*_*126 6 android android-videoview
我有一个尺寸的视频,无论屏幕大小如何,我都希望它始终显示全尺寸。同时,我想保持该视频的纵横比,这样它就不会拉伸,我会造成不好的外观。
我可以像这样完成拉伸效果,但视频看起来很糟糕:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<VideoView android:id="@+id/videoViewRelative"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</VideoView>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
在我的这种情况下,向用户显示整个视频并不重要,所以我需要像 ImageView 那样做的事情:
android:scaleType="centerCrop"
Run Code Online (Sandbox Code Playgroud)
有什么作物替代品VideoView吗?谢谢 :)
| 归档时间: |
|
| 查看次数: |
10346 次 |
| 最近记录: |