青春烈火22集吻戏:RelativeLayout小例子
来源:百度文库 编辑:中财网 时间:2024/04/29 06:17:46
Android布局之RelativeLayout(相对布局) 相对布局由于属性比较多,所以用起来有些费力,但灵活性较其他布局方法好,所以掌握好相对布局将会非常有用。先看等一个例子:
至此,我们已经发现,其属性之繁多。下面简单归纳一下:
第一类:属性值为true或false
*android:layout_centerHrizontal
*android:layout_centerVertical
*android:layout_centerInparent
*android:layout_alignParentBottom
*android:layout_alignParentLeft
*android:layout_alignParentRight
*android:layout_alignParentTop
*android:layout_alignWithParentIfMissing
第二类:属性值必须为id的引用名“@id/id-name”
*android:layout_below
*android:layout_above
*android:layout_toLeftOf
*android:layout_toRightOf
*android:layout_alignTop
第三类:属性值为具体的像素值,如30dip,40px
*android:layout_marginBottom
*android:layout_marginLeft
*android:layout_marginRight
*android:layout_marginTop
再看第二个例子:
第二个例子:
这是很常见的布局内容,讲解如下:android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
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"/>
android:layout_below="@id/label"/>将当前控件放置于id为label 的控件下方。
android:layout_alignParentRight="true"使当前控件的右端和父控件的右端对齐。这里属性值只能为true或false,默认false。
android:layout_marginLeft="10dip"使当前控件左边空出相应的空间。
android:layout_toLeftOf="@id/ok"使当前控件置于id为ok的控件的左边。
android:layout_alignTop="@id/ok"使当前控件与id控件的上端对齐。
至此,我们已经发现,其属性之繁多。下面简单归纳一下:
第一类:属性值为true或false
*android:layout_centerHrizontal
*android:layout_centerVertical
*android:layout_centerInparent
*android:layout_alignParentBottom
*android:layout_alignParentLeft
*android:layout_alignParentRight
*android:layout_alignParentTop
*android:layout_alignWithParentIfMissing
第二类:属性值必须为id的引用名“@id/id-name”
*android:layout_below
*android:layout_above
*android:layout_toLeftOf
*android:layout_toRightOf
*android:layout_alignTop
第三类:属性值为具体的像素值,如30dip,40px
*android:layout_marginBottom
*android:layout_marginLeft
*android:layout_marginRight
*android:layout_marginTop
再看第二个例子:
两个例子的效果图如下:第一个例子:xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:id="@+id/aclock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
android:id="@+id/dclock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/aclock"
android:layout_alignLeft="@id/aclock"
android:layout_marginLeft="40px"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="当前时间:"
android:layout_toLeftOf="@id/dclock"
android:layout_alignTop="@id/aclock"/>
第二个例子:
有小学生科学小实验例子吗
举几个廉洁的小例子
请问哪位有VB的小例子?
怎样写历史小论文?有没有例子?
关于3dsmax6的小例子在哪个网站
有介绍VC++小程序例子的网站吗???
小时侯聪明大了却一事无成的例子
我想看一下文案报告的例子,最好题目小一点
谁能帮我举几个马克思的“适度原则”在生活中的小例子
有关“小的创意可以打开大的突破口”的例子
怎样开发一个人的潜力?有什么好方法?小例子就可以!
谁有简单点的plc西门子s7200的程序小例子
有因为空气中的水蒸气遇到冰凉的杯子而液化成为小水珠例子吗
请问哪儿有如何编写一些小软件的教程或者是例子
有因为空气中的水蒸气遇到冰凉的杯子而液化成为小水珠原理一样的生活例子
生命 例子
学无止境 例子
编程例子
编程例子
人工智能例子
科学例子
环境保护例子
黄金分割例子
典型例子