android 关于listview scrollview 底部 控件无法显示的两个解决方案
方案一
用LinearLayout实现,代码如下:
<!-- 中奖纪录 by mhd -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/imagetip"
android:scaleType="fitXY"
android:src="@drawable/prizelist_ad" />
<ListView
android:layout_width="match_parent"
android:layout_height="0dp"
android:id="@+id/lv_prizelist"
android:layout_weight="1"
>
</ListView>
<include layout="@layout/footer_copyright" android:layout_height="wrap_content" android:layout_width="match_parent" />
</LinearLayout>
重点 ListView的 android:layout_weight="1"
方案二
用RelativeLayout实现,代码如下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" > <Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" // set your button at the bottom
android:layout_centerHorizontal="true"
android:text="Button" /> <ListView
android:id="@android:id/list"
android:layout_above="@+id/button1" // place listview above button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
>
</ListView> </RelativeLayout>
重点是 android:layout_alignParentBottom="true"
android 关于listview scrollview 底部 控件无法显示的两个解决方案的更多相关文章
- 让ListView中的控件失去焦点:android:descendantFocusability="blocksDescendants"
值得注意的是,ListView中的控件不能设置clickable="true",否则会无视父控件的blockDescendants. 可参考: https://segmentfau ...
- android学习日记03--常用控件button/imagebutton
常用控件 控件是对数据和方法的封装.控件可以有自己的属性和方法.属性是控件数据的简单访问者.方法则是控件的一些简单而可见的功能.所有控件都是继承View类 介绍android原生提供几种常用的控件bu ...
- Android开发中目前流行控件和知识点总结
Android开发中目前流行控件和知识点总结 1.SlidingMenu 滑动菜单 应用案例:Facebook . Path 2.0 .人人.网易新闻 下载地址: https://github.c ...
- Android高效率编码-细节,控件,架包,功能,工具,开源汇总,你想要的这里都有
Android高效率编码-细节,控件,架包,功能,工具,开源汇总 其实写博客的初衷也并不是说什么分享技术,毕竟咱还只是个小程序员,最大的目的就是对自我的知识积累,以后万一编码的时候断片了,也可以翻出来 ...
- ScrollView子控件高度设置无效
ScrollView子控件高度设置无效 简述 项目中引入了第三方的下拉刷新包PullToRefreshScrollView. 由于我之前布局未考虑下拉刷新功能.后来暂时发现添加上去,发现.子控件的高度 ...
- Android开源的精美日历控件,热插拔设计的万能自定义UI
Android开源的精美日历控件,热插拔设计的万能自定义UI UI框架应该逻辑与界面实现分离,该日历控件使用了热插拔的设计 ,简单几步即可实现你需要的UI效果,热插拔的思想是你提供你的实现,我提供我的 ...
- Android UI开发之开源控件项目整理
一.Banner 1.https://github.com/youth5201314/banner Android广告图片轮播控件,支持无限循环和多种主题,可以灵活设置轮播样式.动画.轮播和切换时间. ...
- Android布局属性与常用控件
一.Android常用布局属性 1. LinearLayout的特有属性 android:orientation:设置布局排列方式 android:layout_weight:设置所占布局的权重 ...
- Android自定义控件之自定义组合控件
前言: 前两篇介绍了自定义控件的基础原理Android自定义控件之基本原理(一).自定义属性Android自定义控件之自定义属性(二).今天重点介绍一下如何通过自定义组合控件来提高布局的复用,降低开发 ...
随机推荐
- CCF 高速公路 tarjan求强连通分量
问题描述 某国有n个城市,为了使得城市间的交通更便利,该国国王打算在城市之间修一些高速公路,由于经费限制,国王打算第一阶段先在部分城市之间修一些单向的高速公路. 现在,大臣们帮国王拟了一个修高速公路的 ...
- HDU 1710 二叉树遍历
首先.先序遍历是先访问根节点.然后左节点 然后右节点.从根节点开始 直到它的子节点没有左节点才开始回溯访问上一个节点的右节点.同理.中序遍历 先访问左节点 然后是父节点 然后是右节点.从根节点开始 直 ...
- Awk 从入门到放弃 (6) Awk模式(Pattern)之二
第一题:从/etc/passwd 匹配以 vmuser开头的用户 grep “^vmuser” /etc/passwd -r -n awk ‘/^vmuser /{print $0}’ / ...
- spi signal analyze using logic analyzer
logic analyzer device: Saleae Logic 16 Pc software gui: capture signal picture: send command 0x55 ...
- Python 数据类型--Bytes类型
一.Bytes类型 在Python3以后,字符串和bytes类型彻底分开了.字符串是以字符为单位进行处理的,bytes类型是以字节为单位处理的. bytes数据类型在所有的操作和使用甚至内置方法上和字 ...
- Python sqlalchemy使用
import sqlalchemy from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declar ...
- POJ 2309 BST(树状数组Lowbit)
题意是给你一个满二叉树,给一个数字,求以这个数为根的树中最大值和最小值. 理解树状数组中的lowbit的用法. 说这个之前我先说个叫lowbit的东西,lowbit(k)就是把k的二进制的高位1全部清 ...
- 驱动程序多线程 PsCreateSystemThread
内核函数PsCreateSystemThread负责创建新线程.该函数可以创建两种线程,一种是用户线程,它属于当前进程中的线程.另一种是系统线程,系统线程不属于当前用户进程,而是属于系统进程,一般PI ...
- python学习:变量与字符串
counter = # 赋值整型变量 miles = 1000.0 # 浮点型 name = "John" # 字符串 print counter print miles prin ...
- 玩转X-CTR100 | STM32F4 l Malloc内存管理
我造轮子,你造车,创客一起造起来!塔克创新资讯[塔克社区 www.xtark.cn ][塔克博客 www.cnblogs.com/xtark/ ] 内存管理技术,即内存的申请和释放,使用X- ...