Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我通常给定高度以避免视图在方向变化时重叠,但是给重量比这更好..?,如果有更好的方法来提供 LayoutParameter,请分享它。
谢谢你。
这完全取决于情况,比如我的视图何时应该覆盖屏幕上可用的宽度和高度的一部分,然后我会选择重量,何时应该固定尺寸而不考虑宽度、高度,然后使用固定的布局坐标。