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"

>

更多相关文章

  1. Android再学习-20141018-布局-进度条
  2. android的五大布局
  3. Android随笔之布局属性简单用法
  4. Android学习―LinearLayout布局中实现左右对齐
  5. android相对布局 相对对齐
  6. Android常见布局控件之LinearLayout和TableLayout
  7. UI布局参数(持续更新)

随机推荐

  1. Android实现音乐播放 Music 详解
  2. Android(安卓)判断、创建和删除快捷方式
  3. android之JSON解析(二)
  4. Ubuntu13.04环境下载、编译Android源代码
  5. node.js+android(使用HttpURLConnection
  6. Android(安卓)Activty使用示例【慢慢更新
  7. [cocos2dx] cocosdx编译工程那些事
  8. receiver定制自动启动一个程序
  9. Android(安卓)使用RadioGroup和RadioButt
  10. Android驱动入门-在Android系统上运行JAV