Android_RelativeLayout

来源:互联网 发布:晨曦软件win10 编辑:程序博客网 时间:2024/06/05 18:22
//首先说明啊,我这个是练习书上的代码,不是原创的,写这个也是算督促一下自己吧。个人感觉这个就是能够通过调整相对位置的一个方法吧,什么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>

0 0
原创粉丝点击