是否FILL_PARENT或为RelativeLayout的对象match_parent属性的工作真的 [英] Does the fill_parent or match_parent attributes work for a relativeLayout object really
本文介绍了是否FILL_PARENT或为RelativeLayout的对象match_parent属性的工作真的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请问FILL_PARENT或match_parent属性为 RelativeLayout的
对象的工作真的?
Does the fill_parent or match_parent attributes work for a relativeLayout
object really?
请参阅下图:
推荐答案
match_parent
适用于任何看法。
只要你没有分配来抵消你的看法的利润,这将扩大到其父的大小。
match_parent
works on any view.
As long as you don't have margins assigned to offset your view, it will expand to its parent size.
至于为什么你看到它这样的 - 不依赖于Android Studio设计太多。它的存在来显示画面粗糙,但不是precise工具的依靠。
最好的情况下看东西都是精品:
As for why you see it like this - do not rely too much on Android Studio designer. It is there to show a rough picture but is not a precise tool to rely on. Best case to see things are fine:
- 设置临时不同的背景颜色为你(你的情况
RelativeLayout的
)查看与其父布局 - 加载应用程序,并检查是否在你的相对布局显示父颜色
- set a temporary different background color for your view (
RelativeLayout
in your case) and its parent layout - load the app and check if the parent color is shown around your relative layout
这篇关于是否FILL_PARENT或为RelativeLayout的对象match_parent属性的工作真的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文