android的相对布局
2016-10-18 16:18
141 查看
<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="fill_parent"
tools:context=".MainActivity" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="198dp"
android:layout_marginRight="83dp"
android:background="#aaaaaa"
android:text="TextView在左边" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView3"
android:layout_alignBottom="@+id/textView3"
android:layout_centerHorizontal="true"
android:background="#aa00aa"
android:text="@string/hello_world" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/textView2"
android:layout_alignParentLeft="true"
android:layout_marginBottom="54dp"
android:layout_marginLeft="31dp"
android:background="#aaaaaa"
android:text="TextView3"/>
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_alignParentTop="true"
android:layout_alignRight="@+id/textView1"
android:layout_marginTop="14dp"
android:background="#aabbaa"
android:text="TextView4" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/textView3"
android:layout_alignLeft="@+id/textView3"
android:layout_marginBottom="27dp"
android:background="#aabbaa"
android:text="TextView5" />
</RelativeLayout>
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".MainActivity" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="198dp"
android:layout_marginRight="83dp"
android:background="#aaaaaa"
android:text="TextView在左边" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView3"
android:layout_alignBottom="@+id/textView3"
android:layout_centerHorizontal="true"
android:background="#aa00aa"
android:text="@string/hello_world" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/textView2"
android:layout_alignParentLeft="true"
android:layout_marginBottom="54dp"
android:layout_marginLeft="31dp"
android:background="#aaaaaa"
android:text="TextView3"/>
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_alignParentTop="true"
android:layout_alignRight="@+id/textView1"
android:layout_marginTop="14dp"
android:background="#aabbaa"
android:text="TextView4" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/textView3"
android:layout_alignLeft="@+id/textView3"
android:layout_marginBottom="27dp"
android:background="#aabbaa"
android:text="TextView5" />
</RelativeLayout>
相关文章推荐
- android 相对布局 RelativeLayout 属性
- Android相对属性布局总结
- android相对布局
- Android RelativeLayout(相对布局)
- Android 1.5和Android 2.1在相对布局(RelativeLayout)上的区别
- android之相对布局
- Android应用开发之RelativeLayout (相对布局)+梅花效果案例
- 13、从头学Android之RelativeLayout相对布局
- Android UI Design 04 : 相对布局 Relative Layouts
- Android相对布局实现各种梅花效果
- Android布局学习——线性布局和相对布局混合使用
- android之相对布局
- Android界面布局-----RelativeLayout(相对布局)
- Android_RelativeLayout(相对布局)
- android 相对布局属性
- [转]Android布局之RelativeLayout(相对布局)
- Android中的相对布局
- android 相对布局心得
- android 布局之RelativeLayout(相对布局)
- Android 1.5和Android 2.1在相对布局(RelativeLayout)上的区别