系统登陆界面开发及实现之(五)界面版权组件设置

开发步骤:

  • 打开res下layout下activity_login.xml
  • 添加一个TextView组件对象并设置其属性

android:layout_width属性 

  • 作用:设置组件的宽

android:layout_height属性 

  • 作用:设置组件的高 
  • 常量参数:warp_content文本自适应,fill_parent容器自适应

android:gravity属性 

  • 作用:设置对齐方式 
  • 常量参数:center_horizontal 水平对齐

android:layout_marginBottom属性 

  • 作用:设置距离底部的距离

android:layout_alignParentBottom属性

  • 作用:设置为父容器底部对齐

 代码:

<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Copyright@2015 Socrates Reserved."
    android:gravity="center_horizontal"
    android:textSize="12sp"
    android:textColor="#000000"
    android:layout_marginBottom="10dp"
    android:layout_alignParentBottom="true"/>

运行:

 小结:android:layout_alignParentBottom属性必须在父容器是相对布局才能设置!

posted @ 2015-12-22 08:22  阿兰德鱼  阅读(371)  评论(0编辑  收藏  举报