android实现顶部底部标题栏固定 中间可滚动,仿QQ空间的主界面布局
来源:互联网 发布:仿制印章工具怎么用mac 编辑:程序博客网 时间:2024/05/05 11:11
整体效果图:
一、思路:自定义标题栏,只要把系统自带的标题栏去掉(做法:requestWindowFeature(Window.FEATURE_NO_TITLE);),自己再写两个布局块(LinearLayout 布局)充当顶部和底部的标题栏即可,中间使用ScrollView,这种方法有点投机取巧,但是的确很实用。
UI的布局类如下:
public class QQZoneUI extends ActionBarActivity{@Overrideprotected void onCreate(Bundle savedInstanceState) {// TODO Auto-generated method stubsuper.onCreate(savedInstanceState);requestWindowFeature(Window.FEATURE_NO_TITLE);this.setContentView(R.layout.qq_zone);}}
xml布局如下:
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <LinearLayout android:layout_width="fill_parent" android:layout_height="50dip" android:background="#5BBB47" android:orientation="horizontal" tools:ignore="UselessLeaf" > <TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:text="这是头部" tools:ignore="HardcodedText" /> </LinearLayout> <ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="50dip" tools:ignore="UselessLeaf" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" tools:ignore="ScrollViewSize" > <TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="这是中间内容\n这是中间内容\n这是中间内容\n\n\n\n\n\n 这是中间内容\n这是中间内容\n这是中间内容\n\n\n\n\n\n 这是中间内容\n这是中间内容\n这是中间内容\n\n\n\n\n\n 这是中间内容\n这是中间内容\n这是中间内容\n\n\n\n\n\n 这是中间内容\n这是中间内容\n这是中间内容\n\n\n\n\n\n 这是中间内容\n这是中间内容\n这是中间内容\n\n\n\n\n\n" tools:ignore="HardcodedText" /> </LinearLayout> </ScrollView> <LinearLayout android:layout_width="fill_parent" android:layout_height="50dip" android:layout_marginTop="-50dip" android:background="#5BBB47" android:orientation="horizontal" tools:ignore="PxUsage" > <TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:text="这是底部" tools:ignore="HardcodedText" /> </LinearLayout></LinearLayout>
0 0
- android实现顶部底部标题栏固定 中间可滚动,仿QQ空间的主界面布局
- android实现顶部底部固定 中间可滑动
- 顶部和底部固定中间自适应的布局
- Android底部菜单(中间功能键)仿qq空间客户端
- android里,addContentView()动态增加view控件,并实现控件的顶部,中间,底部布局
- android里,addContentView()动态增加view控件,并实现控件的顶部,中间,底部布局
- 仿微信 QQ聊天布局 顶部title固定,底部是EditText,中间是RecyclerView,弹出软键盘,RecyclerView上移,标题不动
- 实现类似QQ、微信聊天界面,标题栏固定,键盘不遮挡底部输入框
- 顶部固定显示;某模块的标题栏在滚动时固定显示;到底部时显示底部banner;回到顶部。4个效果
- 头部和底部固定,中间内容可滚动
- android ScrollView 固定顶部、底部 滑动中间部分
- 仿qq的view滚动到底部或顶部后可以松手回弹
- android-仿QQ界面布局
- Android仿QQ空间底部菜单
- Android仿QQ空间底部菜单
- Android 仿QQ界面的实现
- 上下固定,中间可滚动
- Android --中间突出的底部导航栏布局简单实现
- 摄氏度转成华氏度
- LeetCode Pow(x,n)
- unity学习之继承和封装
- 喜得千金
- PLS_INTEGER
- android实现顶部底部标题栏固定 中间可滚动,仿QQ空间的主界面布局
- Java
- C#中的委托和事件
- HDOJ1160 FatMouse's Speed[dp](最长上升子序列)
- 神器 VisuAlgo:通过动画学习算法和数据结构
- Unicode、UTF-8 和 ISO8859-1到底有什么区别(精品)
- JSP程序设计
- LeetCode N-Queens
- iOS UITableViewDelegate UITableViewDataSource 执行顺序