frameLayout child的 match-parent属性问题
来源:互联网 发布:qt编程html5教程 编辑:程序博客网 时间:2024/06/11 15:35
现在有一个需求
<LinearLayout>
<FrameLayout >
--- <ImageView/>
--- <Button/>
</FragmeLayout>
</LinearLayout>
FrameLayout 的宽度是 wrap-content
ImageView的宽度是 wrap_content
Button的宽度 也是Math-parent的宽度
即外层宽度适配ImageView的宽度。 同时想让Button的宽度与FrameLayout的宽度一致
但是实际运行的时候 发现Button会把FrameLayout撑大。跟最外层的LinearLayout一样宽
为了解决这个问题,需要给Button在嵌套一层LinearLayout
http://stackoverflow.com/questions/4606613/combining-wrap-content-on-parent-and-fill-parent-on-child
In theory what you are describing should not work ("Because it the parent gets it's height from the childs and vice-versa".) However, we made it work in LinearLayout because it was a very common use case. I recently added similar support to FrameLayout (this feature should be part of Honeycomb.) What you are doing is therefore perfectly valid and will work just fine.
- frameLayout child的 match-parent属性问题
- TableRow中child view的match parent失效的问题
- match parent 和 fill parent的区别
- parent > child
- 用Hibernate解决Parent/Child问题
- Android RecyclerView item没有match parent问题
- Android FrameLayout的:layout_marginTop属性失效的问题
- jQuery的parent > child选择器
- 理解elasticsearch的parent-child关系
- 关于APACHE进程重启问题的分析 Parent: child process exited with status 3221225477 -- Restarting
- 【jQuery】parent > child选择器
- $(“parent > child”)选择器
- 【JQuery】parent > child选择器
- parent-child 关系介绍
- jQuery parent>child
- 嵌套Fragment的使用及遇到The specified child already has a parent. You must call removeView()问题的解决
- 嵌套Fragment的使用及遇到The specified child already has a parent. You must call removeView()问题的解决
- 嵌套Fragment的使用及遇到The specified child already has a parent. You must call removeView()问题的解决
- IOS键盘上的“Next”按钮事件,定位到下一个文本框
- make micaz sim 与 lib的使用
- android学习路线和环境搭建、推荐一个博客地址
- Android 属性动画(Property Animation) 完全解析 (下)
- 线索二叉树的完整代码实现
- frameLayout child的 match-parent属性问题
- 定时任务 Crontab命令 详解
- Android中webView与JS的交互
- 【XAMPP】mysql数据库忘记管理员root密码
- Template模板使用中注意的问题(转载)
- 使用Mecanim动画系统来控制2D动画
- 日期对话框DatePickerDialog
- UVa 10646 - What is the Card?
- 因为什么,你离开了那座城?