Android布局:保持在底部的按钮栏,上面是滚动的ScrollView的实现方式
2012-11-30 11:37
633 查看
第一种: (相对布局来实现)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/buttonLayout"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal">
<Button android:text="BBBB"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="1"/>
</LinearLayout>
<ScrollView
android:layout_above="@id/buttonLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ScrollView>
</RelativeLayout>
第二种: (权重来实现)
<LinearLayout
android:layout_height="fill_parent"
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:orientation="vertical" >
<ScrollView
android:layout_height="0dp"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_weight="8" >
。。。。。。
</ScrollView>
<LinearLayout
android:layout_height="0dp"
android:id="@+id/llybuttom"
android:layout_width="match_parent"
android:orientation="vertical"
android:background="@color/black"
android:layout_weight="1" >
<Button
android:id="@+id/btregist"
android:layout_height="wrap_content"
android:layout_width="match_parent" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/buttonLayout"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal">
<Button android:text="BBBB"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="1"/>
</LinearLayout>
<ScrollView
android:layout_above="@id/buttonLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ScrollView>
</RelativeLayout>
第二种: (权重来实现)
<LinearLayout
android:layout_height="fill_parent"
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:orientation="vertical" >
<ScrollView
android:layout_height="0dp"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_weight="8" >
。。。。。。
</ScrollView>
<LinearLayout
android:layout_height="0dp"
android:id="@+id/llybuttom"
android:layout_width="match_parent"
android:orientation="vertical"
android:background="@color/black"
android:layout_weight="1" >
<Button
android:id="@+id/btregist"
android:layout_height="wrap_content"
android:layout_width="match_parent" />
</LinearLayout>
</LinearLayout>
相关文章推荐
- Android - 保持在底部的按钮栏,上面是滚动的ScrollView
- Android - 保持在底部的按钮栏,上面是滚动的ScrollView
- android实现上面的内容滚动,底部放置一固定的按钮的方法
- android 布局 实现底部表单中底部按钮悬浮
- Android 利用ScrollView实现布局自动滚动
- Android进阶篇之ListView、GridView以及ScrollView实现按钮控制滚动
- android 布局 实现底部表单中底部按钮悬浮
- android实现底部按钮布局
- android实现底部按钮布局
- Android 监听 ScrollView 滑动到最底部,实现阅读协议,滑动到最低端显示已阅读按钮(2017版本)
- android 布局 实现底部表单中底部按钮悬浮
- UI篇--android实现底部按钮布局
- Android的按钮Button单击事件及监听器的实现方式
- android标题栏颜色渐变效果的实现(标题栏随着scrollview的滚动而变化)
- Android实现计算器布局(四种布局方式)之LinearLayout线性布局
- Android 高仿新浪微博底部导航栏,实现双击首页Tab,页面的ListView滚动、刷新
- Android 对ScrollView滚动监听,实现美团、大众点评的购买悬浮效果
- Android的按钮单击事件及监听器的实现方式
- android里,addContentView()动态增加view控件,并实现控件的顶部,中间,底部布局
- 关于Android线性布局与滚动实现