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自定义控件之自定义属性(二).今天重点介绍一下如何通过自定义组合控件来提高布局的复用,降低开发 ...
随机推荐
- [工作代码]dom4j解析实例
工作中,我需要和另一个公司(A公司)共同开发一个模块,我写一个servlet接口,A公司携带xml格式的报文来访问.我采用流的形式读取,在处理后以流的形式写入,在返回(相应)给A公司. demo: p ...
- net start mysql启动mysql,提示发生系统错误 5 拒绝访问 解决方法
解决问题方法如下: 在dos下运行net start mysql 不能启动mysql!提示发生系统错误 5:拒绝访问!切换到管理员模式就可以启动了.所以我们要以管理员身份来运行cmd程序来启动mys ...
- git添加本地项目到git
1.切换到项目所在文件夹下:git int 2.git add -A 3.git commit -m '11' 4.git remote add origin https://github.com/g ...
- SWIFT Scan QRCode
SWIFT中扫描QRCode代码如下,照着敲一次再看下API的注释应该就没问题了. import UIKit import Foundation import AVFoundation class V ...
- (libev) cannot allocate xxx bytes, aborting 问题的一种触发条件
最近在项目中使用了libev,遇到一个很奇怪的crash,服务器运行随机时间后有一定的概率奔溃,输出的最后一行log是: (libev) cannot allocate xxx bytes, abor ...
- jmeter随笔(31)--RandomString和Random函数使用
在使用jmeter中,用到了一些自带的函数,后面我逐步把自己用到的分享出来,当然这些是比较简单的,也可自己看看英文文档,小怪这里只是结合自己分享. 视频介绍: https://v.qq.com/x/p ...
- C高级第四次作业
作业要求一 最简单的wordcount 具体要求:http://www.cnblogs.com/xinz/p/7426280.html 1.设计思路: 0.0版本设计思路: 第一步:读入用户想要操作的 ...
- c++跨文件变量声明
常量是内部链接的,可以直接定义; 变量是外部链接,如果在头文件定义的话,如果出现多次引用同一个头文件的编译单元,就会引发multi redifine错误, 这个时候就要只是声明变量来解决:exter ...
- Nuxt开发搭建博客系统
nuxt.js第三方插件的使用?路由的配置pages目录自动生成路由layoutsdefault.vueerror.vueVuex的使用权限篇Mysqladvice nuxt.js 追求完美,相信大家 ...
- MyEclipse2014配置Tomcat开发JavaWeb程序JSP以及Servlet
http://blog.csdn.net/21aspnet/article/details/21867241 1.安装准备 1).下载安装MyEclipse2014,这已经是最新版本. 2).下载 ...