青铜

布局

两种

  1. LinearLayout线性布局
  2. RealtiveLayout相对布局

组件属性

1.android:layout_width
  android:layout_height
  属性值:  match_parent:与父窗口保持一致
           wrap_content:按照其中的内容自动调整大小       也可以设置组件的padding来控制组件的显示位置
2,orietation,方向属性,用来显示方向的可以使

给组件加上id

添加方式

android:id="@+id/aaa"/后面是id名
使用时,在java代码中可以直接
Button b=(Button) findViewById(R.id.aaa)

猜你喜欢

转载自blog.csdn.net/weixin_34279061/article/details/91026119