Android学习笔记(二)

来源:互联网 发布:网狐荣耀 源码 编辑:程序博客网 时间:2024/05/11 16:06
1.android:gravity="center_horizontal"(这个是线性布局中的标签属性)    android:layout_centerHorizontal="true"(这个是相对布局中的标签属性)


2.在LinearLayout中 android:layout_marginBottom 属性不起作用,只有  android:layout_marginTop才起作用,因为线性布局是从上到下进行排版的,


3.界面设计最好用相对布局,若用线性布局手机横屏后,由于界面高度不适应,则还需设置滚动条,这样一来比较麻烦!!


4. <Button
            android:id="@+id/register"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_marginBottom="2dp"
            android:layout_below="@id/othinfo"
            android:text="@string/register" />
      button按钮不能置底,把android:layout_below="@id/othinfo"语句删了后        就Ok啦!!!


5.编码规范问题:控件的id要规范:控件名_id名 
 
6.实现软件的多种语言版本问题:
      在res文件夹下新建一个文件夹,比如中文版本,文件名values-zh-rCN,在该       文件夹下新建一个strings.xml文件,然后在该文件中编写代码,系统会自动      识别语言!
原创粉丝点击