Android 如何使MediaController永久停靠
我正试图在我的活动底部设置一组永久的媒体控件。我尝试扩展MediaController来实现这一点,但它总是与屏幕重叠,而不是拥有自己的空间。我也试着在我的布局中定义它,如下所示,但没有成功。你知道我怎样才能做到这一点吗Android 如何使MediaController永久停靠,android,Android,我正试图在我的活动底部设置一组永久的媒体控件。我尝试扩展MediaController来实现这一点,但它总是与屏幕重叠,而不是拥有自己的空间。我也试着在我的布局中定义它,如下所示,但没有成功。你知道我怎样才能做到这一点吗 <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ScrollView android:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
...
</ScrollView>
<.MyMediaController
android:id="@+id/myMediaController1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" />
</RelativeLayout>
你能发布相对版面属性吗?添加了相对版面属性怪异,看起来不错。您可以尝试为每个视图设置不同的背景色,并查看确切的布局。媒体控制器的位置与滚动视图无关,因为您位于相对布局内。正如@LiorOhana所说,允许覆盖效果的是相对视图。更改为垂直线性布局,并将ScrollView和MediaController的布局高度属性设置为0dp,并为它们提供两个布局重量属性,以设置它们占据屏幕高度的百分比。