开发者

Hierachy of android:layout_width/ height between containers and views

What is the relationship between android:layout_width & android:layout_height in the container and the views contained within?

For instance if I have a LinearLayout with the layout width and height set to fill_parent, and I have a Button with those values set to wrap_content it uses the value from the Button, like the Button values overide the LinearLayout.

However if i swap them around so that the LinearLayout values are both wrap_content and the Bu开发者_StackOverflowtton values are now fill_parent it still uses wrap_content, this time not overriding the values, but using the values supplied with the LinearLayout.

Could someone explain how they relate as this is very confusing to me?

Thanks

Kyros


http://developer.android.com/guide/topics/ui/how-android-draws.html This article explains it very well

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜