1 android XML "android:id"中不能出现下划线
2 layout_width="fill_parent" ,自动填充至屏幕宽度,layout_height 同理
3 layout_width="wrap_content" ,自动填充为控件大小,layout_height 同理
4 LinearLayout ,在入门第一篇所用的Layout 就是LinearLayout ,它的理解很简单:在LinearLayout 里面的控件,按照水平或者垂直排列:
orientation="horizontal" :水平排列;orientation=" vertical" :垂直排列
当LinearLayout 是horizontal ,并且里面的控件使用了layout_width="fill_parent" ,第二组控件会挡在屏幕的右边,那也就是看不到了。。。
AbsoluteLayout ,是一个按照绝对坐标定义的布局,由于使用绝对坐标去定位控件,因此要实现自适应界面时,应尽少使用 AbsoluteLayout 。 AbsoluteLayout 里面的控件都以layout_x 、layout_y 来定义其位置:
5 在RelativeLayout布局里的控件包含丰富的排列属性:
Layout above:选择ID A,则该控件在A控件的上方,Layout below、Layout to left of。。。。等同样用法。使用RelativeLayout布局的时候,最好在界面设计时做好布局,尽少程序运行时做控件布局的更改,因为RelativeLayout布局里面的属性之间,很容易冲突,例如,Layout below、Layout above同选 ID A,那就肯定发生冲突了。
FrameLayout,顾名思义跟帧有关,布局里所有的控件都被放到布局的左上角,并且一层覆盖一层。