Android中RelativeLayout各个属性

Android中RelativeLayout各个属性 android:layout_alignParentLeft=”true”找不到有时候

2014年09月05日 ⁄ 综合 ⁄ 共 945字 ⁄ 字号    ⁄ 评论关闭

android:layout_above="@id/xxx"  --将控件置于给定ID控件之上
android:layout_below="@id/xxx"  --将控件置于给定ID控件之下

android:layout_toLeftOf="@id/xxx"  --将控件的右边缘和给定ID控件的左边缘对齐
android:layout_toRightOf="@id/xxx"  --将控件的左边缘和给定ID控件的右边缘对齐

android:layout_alignLeft="@id/xxx"  --将控件的左边缘和给定ID控件的左边缘对齐
android:layout_alignTop="@id/xxx"  --将控件的上边缘和给定ID控件的上边缘对齐
android:layout_alignRight="@id/xxx"  --将控件的右边缘和给定ID控件的右边缘对齐
android:layout_alignBottom="@id/xxx"  --将控件的底边缘和给定ID控件的底边缘对齐
android:layout_alignParentLeft="true"  --将控件的左边缘和父控件的左边缘对齐
android:layout_alignParentTop="true"  --将控件的上边缘和父控件的上边缘对齐
android:layout_alignParentRight="true"  --将控件的右边缘和父控件的右边缘对齐
android:layout_alignParentBottom="true" --将控件的底边缘和父控件的底边缘对齐
android:layout_centerInParent="true"  --将控件置于父控件的中心位置
android:layout_centerHorizontal="true"  --将控件置于水平方向的中心位置
android:layout_centerVertical="true"  --将控件置于垂直方向的中心位置

其中很重要的android:layout_alignParentLeft="true"  --将控件的左边缘和父控件的左边缘对齐有时候找不到知道为啥?

那是因为你的父控件不是相对布局,当你的父控件是相对布局,子控件才能显示这个属性哦,大家要注意哦

时间: 2024-08-07 00:15:20

Android中RelativeLayout各个属性的相关文章

Android中RelativeLayout各个属性的含义

androidlayout android:layout_above="@id/xxx"        --将控件置于给定ID控件之上 android:layout_below="@id/xxx"        --将控件置于给定ID控件之下 android:layout_toLeftOf="@id/xxx"     --将控件的右边缘和给定ID控件的左边缘对齐 android:layout_toRightOf="@id/xxx&quo

(转)Android中RelativeLayout各个属性的含义

转:http://blog.csdn.net/softkexin/article/details/5933589 android:layout_above="@id/xxx"  --将控件置于给定ID控件之上android:layout_below="@id/xxx"  --将控件置于给定ID控件之下 android:layout_toLeftOf="@id/xxx"  --将控件的右边缘和给定ID控件的左边缘对齐android:layout_t

Android中RelativeLayout各个属性 android:layout_alignParentLeft=”true”找不到有时候

android:layout_above="@id/xxx"  --将控件置于给定ID控件之上android:layout_below="@id/xxx"  --将控件置于给定ID控件之下 android:layout_toLeftOf="@id/xxx"  --将控件的右边缘和给定ID控件的左边缘对齐android:layout_toRightOf="@id/xxx"  --将控件的左边缘和给定ID控件的右边缘对齐 andr

Android 中RelativeLayout各个属性的含义

转载博客:http://blog.csdn.net/softkexin/article/details/5933589 android:layout_above="@id/xxx" --将控件置于给定ID控件之上 android:layout_below="@id/xxx" --将控件置于给定ID控件之下 android:layout_toLeftOf="@id/xxx" --将控件的右边缘和给定ID控件的左边缘对齐 android:layout

Android中RelativeLayout和LinearLayout性能分析

先看一些现象吧:用eclipse或者Android studio,新建一个Activity自动生成的布局文件都是RelativeLayout,或许你会认为这是IDE的默认设置问题,其实不然,这是由 android-sdk\tools\templates\activities\BlankActivity\root\res\layout\activity_simple.xml.ftl 这个文件事先就定好了的,也就是说这是Google的选择,而非IDE的选择.那SDK为什么会默认给开发者新建一个默认的

android中xmlns:tools属性详解

第一部分 安卓开发中,在写布局代码的时候,ide可以看到布局的预览效果. 但是有些效果则必须在运行之后才能看见,比如这种情况:TextView在xml中没有设置任何字符,而是在activity中设置了text.因此为了在ide中预览效果,你必须在xml中为TextView控件设置android:text属性 <TextView android:id="@+id/text_main" android:layout_width="match_parent" and

android中xml tools属性详解

第一部分 安卓开发中,在写布局代码的时候,ide可以看到布局的预览效果. 但是有些效果则必须在运行之后才能看见,比如这种情况:TextView在xml中没有设置任何字符,而是在activity中设置了text.因此为了在ide中预览效果,你必须在xml中为TextView控件设置android:text属性 1 2 3 4 5 6 7 <TextView   android:id="@+id/text_main"   android:layout_width="matc

android中xml tools属性详解(转)

第一部分 安卓开发中,在写布局代码的时候,ide可以看到布局的预览效果. 但是有些效果则必须在运行之后才能看见,比如这种情况:TextView在xml中没有设置任何字符,而是在activity中设置了text.因此为了在ide中预览效果,你必须在xml中为TextView控件设置android:text属性 1 2 3 4 5 6 7 <TextView   android:id="@+id/text_main"   android:layout_width="matc

Android中Edittext的属性

//此为转载别人的,挺不错的 1.EditText输入的文字为密码形式的设置 (1)通过.xml里设置: 把该EditText设为:android:password="true" // 以”.”形式显示文本 (2)在代码里设置: 通过设置EditText的setTransformationMethod()方法来实现隐藏密码或这显示密码. editText.setTransformationMethod(PasswordTransformationMethod.getInstance()