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.
我在RelativeLayout 中有LinearLayout。我想以编程方式更改 LinearLayout 的高度。我试过用 LinearLayout.LayoutParams 来做这件事,但我有一个例外。如何解决这个问题呢?谢谢。
尝试使用RelativeLayout.LayoutParams,因为父级是RelativeLayout。
RelativeLayout.LayoutParams
LayoutParams 的类型取决于父类型。