您的位置:首页 > 移动开发 > Android开发

让两个布局都在同一个控件的上方

2017-04-16 22:50 183 查看
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<View
android:id="@+id/view_top1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/tv_test"
android:background="@android:color/darker_gray"/>
<View
android:id="@+id/view_top2"
android:layout_above="@+id/tv_test"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/holo_red_dark"
android:visibility="gone"/>

<TextView
android:id="@+id/tv_test"
android:layout_alignParentBottom="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
</RelativeLayout>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android 布局
相关文章推荐