android listview scrollview auto adapter ui
来源:互联网 发布:淘宝网界面设计分析 编辑:程序博客网 时间:2024/05/16 05:25
后来在 elong 摇摇订酒店 项目中发现一个BUG。 就是 当 手机的屏幕尺寸比较大的时候。。。底部的“带我去酒店” 和 scrollview 的间距就变得很大, UI 不美观。
后来解决方案是 将 scrollview 的 layout_weight = 100, 在 “带我去酒店” 的下面再添加一个 空的 适配 LinearLayout . 将其layout_weight = 1. layout_height = 1.
适配组建的代码
<LinearLayout android:layout_width="fill_parent" android:layout_height="1dip" android:layout_weight="1" > </LinearLayout>
总的来说 , 组建是 按照 layout_weight 按照比例来分配大小的。。。,比如
s = 1 a = 1 那么 s 的高度 /a 的高度= 1/1.
s = 2 a = 1 那么 s 的高度 /a 的高度= 2/1.
s = 2 a = 2 那么 s 的高度 /a 的高度= 2/2.
在开发过程中终于又领会到 layout_weight 的含义。。。 假设 ScrollView 为 S 添加到最后适配用的 LinearLayout 为 A。 下面 给出 S 和 A layout_weight 不同的时候的截图。。
X:
S 1 / A 1 s2/a1
s2 / a2 s100/a1
- android listview scrollview auto adapter ui
- Android UI(ImageView CheckBox)、ListView和Adapter
- android ScrollView嵌套ListView adapter的notifyDataSetChanged无效
- Android UI设计:ListView 控件与 Adapter 适配器
- Android UI学习——ListView 和Adapter
- Android UI基础——ListView控件及Adapter适配器
- Android UI基础之ListView 和适配器Adapter
- Android仿小米商城商品详情界面UI,ScrollView嵌套ScrollView/WebView/ListView
- Android UI之Adapter
- Android ListView Adapter
- android listview中的adapter
- Android ListView重写Adapter
- android开发--ListView&Adapter
- Android UI之ScrollView
- Android-UI之ScrollView
- Android--UI之ScrollView
- android ScrollView嵌套ListView
- android ScrollView嵌套ListView
- 建立带有圆角样式的路径
- ruby openstruct
- mysql 添加新用户和数据库
- 给海归技术创业兄弟的九个忠告
- SpringBeanRouter分析
- android listview scrollview auto adapter ui
- java内存泄漏总结
- BF533之UBOOT启动过程分析
- js字符串编码方法总结
- hibernate注解
- LCD Backlight 的分析
- 单例模式
- shell脚本按行读取配置文件并解析
- Spring AOP 用法初探