贞布局有FrameLayout所代表,它直接继承了ViewGroup组建贞布局为每个加入其中的组件创建一个空白区域(一帧),所以每个子组件占用一帧,这些贞都会根据gravity属性执行自动对齐贞布局在游戏开发中使用较多 属性相关方法说明Android:foregroundse ...
- 贞布局有FrameLayout所代表,它直接继承了ViewGroup组建
- 贞布局为每个加入其中的组件创建一个空白区域(一帧),所以每个子组件占用一帧,这些贞都会根据gravity属性执行自动对齐
- 贞布局在游戏开发中使用较多
属性 | 相关方法 | 说明 |
Android:foreground | setForeground | 设置该贞的前景图形 |
Android:foregroundGravity | SetForegroundGavity | 定义绘制前景图形的gravity属性 |
布局代码:
<FrameLayout ="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/View01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="210dp" android:height="50dp" android:background="#ff0000" /> <TextView android:id="@+id/View02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="180dp" android:height="50dp" android:background="#dd0000" /> <TextView android:id="@+id/View03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="150dp" android:height="50dp" android:background="#bb0000" /> <TextView android:id="@+id/View04" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="120dp" android:height="50dp" android:background="#990000" /> <TextView android:id="@+id/View05" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="90dp" android:height="50dp" android:background="#770000" /> <TextView android:id="@+id/View06" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="60dp" android:height="50dp" android:background="#550000" /> <TextView android:id="@+id/View07" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="30dp" android:height="50dp" android:background="#330000" /> </FrameLayout>
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:Android布局管理器(贞布局)
关键词:Android
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。