Android --固定底部
2024-10-20 20:36:08
相对布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.dr.app.drseamoniter.HistoryDataFragment"> <ListView android:id="@+id/history_data_list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_above="@+id/history_data_bottom"/> <LinearLayout android:id="@+id/history_data_bottom" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:layout_alignParentBottom="true"> <ImageView android:id="@+id/page_back" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:src="@drawable/page_back"/> <EditText android:id="@+id/page" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:textSize="12sp" android:layout_weight="1"/> <ImageView android:id="@+id/page_forward" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:layout_weight="1" android:src="@drawable/page_forward"/> <TextView android:id="@+id/total_page_count" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/data_list_page_count" android:gravity="center" android:textSize="12sp" android:layout_weight="1"/> <TextView android:id="@+id/total_count" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/data_list_count" android:gravity="center" android:textSize="12sp" android:layout_weight="1"/> </LinearLayout> </RelativeLayout >
参考博客:Android常见错误
在相对布局中,若是用到android:layout_above属性,并且其后id之前没有出现过,那么需要这样写:android:layout_above="@+id/vidAdd_ButtonGroup",多加一个“+”。
最新文章
- ACM/ICPC 之 有流量上下界的网络流-Dinic(可做模板)(POJ2396)
- js事件(event)的运行原理
- 通过3个Hello World应用来了解ASP.NET 5应用是如何运行的(2)
- Unity学习疑问记录之将图切割保存
- JS获取地址栏参数的方法
- Android总结篇系列:Activity Intent Flags及Task相关属性
- 轻易实现基于linux或win运行的聊天服务端程序
- UnityShader之Shader分类篇【Shader资料2】
- 《HTML5高级程序设计》知识点概要(不涉及详细语法)
- Oracle:Authid Current_User使用
- poj1458
- WPF中ListView如何改变选中条背景颜色
- asp.net:录入数据库的中文变问号
- Title of live Writer
- MySQL ubuntu启动
- POJ2503 Babelfish
- C语言的声明和定义
- 【原创】leetCodeOj --- Find Minimum in Rotated Sorted Array II 解题报告
- C# 语言规范_版本5.0 (第9章 命名空间)
- SUCTF--WEB