在我的项目中,我将width和height的线性布局视为full_parent,并且我将宽度和高度的VideoView添加为fill_parent,但视频不占用整个屏幕。无法以全屏模式播放Android VideoView。
在此先感谢。
在我的项目中,我将width和height的线性布局视为full_parent,并且我将宽度和高度的VideoView添加为fill_parent,但视频不占用整个屏幕。无法以全屏模式播放Android VideoView。
在此先感谢。
在XML定义试试你的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/videoView1" android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"></VideoView>
</RelativeLayout>
把之前的setContentView这段代码你的活动
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
我认为它可以帮助你。
我已经尝试过,但我无法得到结果。 – user897936
请在这里给一些代码,以便我可以检查 – bindal
雅我也这样想,但我没有得到预期的结果。感谢您的答复 – user897936
把你的XML代码有问题,所以其他人可以知道你在尝试什么,可以帮助你 – MKJParekh