开发者

gravity="fill_vertical" vs. layout_height="fill_parent" in Android

开发者 https://www.devze.com 2022-12-27 19:28 出处:网络
Why does gravity offer a \"fill_vertical\" option? How i开发者_开发问答s this any different from setting layout_height \"fill_parent\"? What if I choose a fixed layout_height and \"fill_vertical\" for

Why does gravity offer a "fill_vertical" option? How i开发者_开发问答s this any different from setting layout_height "fill_parent"? What if I choose a fixed layout_height and "fill_vertical" for gravity? Won't this contradict?


I believe that using gravity="fill_vertical" indicates that the View should take up as much space as possible vertically while still respecting other Views' height constraints. If you use layout_height="fill_parent", you're telling the View to take up the entire parent's height; this may result in a single View pushing other Views off the viewport.

0

精彩评论

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

关注公众号