Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/222.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
调整android videoview的大小以适应屏幕_Android_Android Videoview - Fatal编程技术网

调整android videoview的大小以适应屏幕

调整android videoview的大小以适应屏幕,android,android-videoview,Android,Android Videoview,我想全屏播放视频。 我这样设置xml android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_alignParentRight="true" android:layout_alignParentBottom="true" 它在安

我想全屏播放视频。 我这样设置xml

android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
它在安卓4.1中运行良好,但在安卓4.2中不起作用

android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"

你的意思是同时隐藏状态栏吗?在
setContentView
之前添加以下行


此外,自定义视图,从VideoView扩展,并将
onMeasure()覆盖为全屏大小。

谢谢。我已经尝试覆盖
protectedvoid onMeasure(int-widthMeasureSpec,int-heightMeasureSpec){DisplayMetrics dm=getResources().getDisplayMetrics();int-screenWidth=dm.widthPixels;int-screenHeight=dm.heightPixels;setMeasuredDimension(screenWidth,screenHeight);}
在4.2版上也不起作用