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

Android五大布局之RelativeLayout 示例代码

2012-12-25 12:49 435 查看
<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="match_parent"

android:layout_height="match_parent" >

<TextView

android:id="@+id/numberTV"

android:layout_width="80dp"

android:layout_height="wrap_content"

android:text="@string/number" />

<EditText

android:id="@+id/numberET"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_toRightOf="@id/numberTV"

android:inputType="phone" />

<TextView

android:id="@+id/contentTV"

android:layout_width="80dp"

android:layout_height="wrap_content"

android:layout_below="@id/numberET"

android:text="@string/content" />

<EditText

android:id="@+id/contentET"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_alignLeft="@+id/numberET"

android:layout_alignParentRight="true"

android:layout_alignTop="@+id/contentTV"

android:ems="10"

android:inputType="textMultiLine"

android:lines="3" />

<Button

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_alignParentRight="true"

android:layout_below="@+id/contentET"

android:onClick="onClick"

android:text="@string/send" />

</RelativeLayout>

效果图:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: