Android(安卓)让一个控件或布局居于底部的办法
android 让一个控件按钮居于底部的几种方法
1.采用linearlayout布局:
android:layout_height="0dp"
android:layout_weight="1"
2. 采用relativelayout布局:
android:layout_alignParentBottom="true"
3. 采用 fragment 布局(activitygroup 已经被弃用不建议使用)
=====================================
1.采用linearlayout布局:
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
android:id="@+id/content"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="vertical">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/runbackground"
android:focusable="false" />
2. 采用relativelayout布局:
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/runbackground"
android:focusable="false" />
3. 采用 fragment 布局(activitygroup 已经被弃用不建议使用)
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
android:layout_width="0px" android:layout_height="match_parent"
/>
android:background="?android:attr/detailsElementBackground"
>
更多相关文章
- Android(安卓)让一个控件或布局居于底部的办法
- Android中定义数组与使用
- Android(安卓)性能优化的一些方法
- Android(安卓)Google Map V2 备忘
- Android(安卓)利用隐藏API实现屏幕亮度调节
- Android开发中修改程序字体
- Android(安卓)数据库Sqlite的使用(1)
- Android——SQLite使用
- 我的Android第一步