android:layout_weight="1"

权重,控制控件之间的地位,在控制控件显示的大小时蛮有用的。

android:layout_alignWithParentIfMissing

如果对应的兄弟元素找不到的话就以父元素做参照物

android:sigleLine
如果设置为真的话,则控件的内容在同一行中进行显示

android:layout_centerVertical
垂直居中
android:layout_centerInparent
相对于父元素完全居中
android:layout_alignParentBottom
贴紧父元素的下边缘
android:layout_alignParentLeft
贴紧父元素的左边缘
android:layout_alignParentRight
贴紧父元素的右边缘
android:layout_alignParentTop
贴紧父元素的上边缘
android:layout_alignWithParentIfMissing
如果对应的兄弟元素找不到的话就以父元素做参照物

android:layout_gravity是用来设置该view相对与起父view 的位置.比如一个button 在linearlayout里,你想把该button放在靠左、靠右等位置就可以通过 该属性设置.以button为例,android:layout_gravity="right"则button靠右

android:scaleType:

android:scaleType是控制图片如何resized/moved来匹对ImageView的size。

下面是一些扩展的风格属性

android:editable="false" 设置EditText不可编辑

android:singleLine="true" 强制输入的内容在单行

android:ellipsize="end" 自动隐藏尾部溢出数据,一般用于文字内容过长一行无法全部显示时

RelativeLayout布局

android:layout_marginTop="25dip" //顶部距离

android:gravity="left" //空间布局位置

android:layout_marginLeft="15dip //距离左边距

android:phoneNumber设置为电话号码的输入方式。

android:privateImeOptions设置输入法选项,此处无用,在EditText将进一步讨论。

android:scrollHorizontally设置文本超出TextView的宽度的情况下,是否出现横拉条。

android:selectAllOnFocus如果文本是可选择的,让他获取焦点而不是将光标移动为文本的开始位置或者末尾位置。 TextView中设置后无效果。

android:shadowColor指定文本阴影的颜色,需要与shadowRadius一起使用。

android:shadowDx设置阴影横向坐标开始位置。

android:shadowDy设置阴影纵向坐标开始位置。

android:shadowRadius设置阴影的半径。设置为0.1就变成字体的颜色了,一般设置为3.0的效果比较好。

android:singleLine设置单行显示。如果和layout_width一起使用,当文本不能全部显示时,后面用"…"来表示。如android:text="test_ singleLine "

android:singleLine="true" android:layout_width="20dp"将只显示"t…"。如果不设置singleLine或者设置为false,文本将自动换行

android:text设置显示文本.

android:textAppearance设置文字外观。如 "?android:attr/textAppearanceLargeInverse"这里引用的是系统自带的一个外观,?表示系统是否有这种外观,否则使用默认的外观。可textAppearanceButton/textAppearanceInverse/textAppearanceLarge/textAppearanceLargeInverse/textAppearanceMedium/textAppearanceMediumInverse/textAppearanceSmall/textAppearanceSmallInverse



更多相关文章

  1. Android进阶(二十二)设置TextView文字水平垂直居中
  2. ImageView 设置 maxWidth/maxHeight 和 adjustViewBounds
  3. Android(安卓)网络通信——HttpURLConnection
  4. 【Android】Android中 Paint 字体、粗细等属性的一些设置
  5. android:windowSoftInputMode属性的使用
  6. Android(安卓)编辑框(EditText)属性学习
  7. 【Android(安卓)应用开发】Activity 任务亲和性 taskAffinity 设
  8. Android系统中设置TextView的行间距(非行高)
  9. Scroll,

随机推荐

  1. Android(安卓)Lint工具学习
  2. Android开发入门之网络通信(网页源码查看
  3. Android(安卓)中显示 Gif 格式图
  4. android 在UI线程之外处理Bitmap - 开发
  5. 左滑与右滑/单击事件/长按事件/OnTouch()
  6. android getFragmentManager、getSupport
  7. android.support.v7包添加
  8. Android启动第三方应用程序
  9. Android(安卓)APP —— “时光摄影” 的
  10. Android中Handler、HandlerThread、Async