停止自动调整Android视频视图的大小
我在一个相对的布局中实现了一个视频视图。我已经为我的相对布局设置了特定的停止自动调整Android视频视图的大小,android,android-layout,android-videoview,android-xml,Android,Android Layout,Android Videoview,Android Xml,我在一个相对的布局中实现了一个视频视图。我已经为我的相对布局设置了特定的layoutWidth和layouthweight,并且正在尝试匹配视频视图的父视图 我的问题是视频视图不会响应代码 这是我的XML视图: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android
layoutWidth
和layouthweight
,并且正在尝试匹配视频视图的父视图
我的问题是视频视图不会响应代码
这是我的XML视图:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="800dp"
android:layout_height="600dp"
android:background="@drawable/background"
android:orientation="vertical" >
<!-- Header -->
<include
android:id="@+id/include1"
layout="@layout/video_menu_header" />
<VideoView
android:id="@+id/videoView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/include1"
android:layout_centerHorizontal="true"
/>
</RelativeLayout>
为什么视频视图没有填满相对窗口?我找到了解决方案。我想做的是根据相对宽度和高度调整视频视图的大小。我将代码修改为:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="600dp"
android:background="@drawable/background"
android:orientation="vertical" >
<!-- Header -->
<include
android:id="@+id/include1"
layout="@layout/video_menu_header" />
<VideoView
android:id="@+id/videoView1"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/include1"
android:layout_centerHorizontal="true"
/>
</RelativeLayout>
可能重复:问题没有明确说明。“不响应代码”并没有真正的帮助。说明它在做什么,以及你期望它做什么。