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

Android_RelativeLayout

2016-12-01 19:58 183 查看
//首先说明啊,我这个是练习书上的代码,不是原创的,写这个也是算督促一下自己吧。
个人感觉这个就是能够通过调整相对位置的一个方法吧,什么below 啊 toLetfOf 啊什么的,但是我比较困惑的是,android:background="@android:drawable/editbox_background",这句应该是调整背景的,但是我做出来没什么变化。简直尴尬了。


<?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/label"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="Please input something ! "

/>

<EditText

android:id="@+id/entry"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:background="@android:drawable/editbox_background"

android:layout_below="@id/label"

/>

<Button

android:id="@+id/ok"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/entry"

android:layout_alignParentRight="true"

android:layout_marginLeft="10dip"

android:text="OK"

/>

<Button

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_toLeftOf="@id/ok"

android:layout_alignTop="@id/ok"

android:text="Cancel"/>

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