markdowneide 2013-06-25 02:21 采纳率: 0%
浏览 7407

android 布局的优先级问题

XML 代码:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/RelativeLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    <RelativeLayout
        android:id="@+id/relativeLayout2"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:visibility="invisible">
        <ImageButton
            android:id="@+id/video_playback_pause"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
         <SeekBar
            android:id="@+id/seekbar_video"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" android:layout_below="@id/video_playback_pause" android:clickable=""/>
    </RelativeLayout>
     <VideoView
        android:id="@+id/videoView1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_centerInParent="true" />
</RelativeLayout>

现在当RelativeLayout 和 VideoView 重写后,VideoView能显示, RelativeLayout被隐藏。
如何把RelativeLayout 放在VideoView的上面?
还有为什么 seekbar 不能点击?
我发现 layout 的优先级是由创建顺序决定的。

  • 写回答

2条回答 默认 最新

  • JaveZh 2013-06-25 02:24
    关注

    android:id="@+id/videoView1"
    android:layout_below="@+id/relativeLayout2"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_centerInParent="true" />

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!