简体   繁体   中英

How to adjust child view height after resizing its parent ViewGroup?

I have custom view which extends RelativeLayout and has child element with height set to "fill_parent". The problem is that adjusting parents height doesn't affect its child height. How can I force child to fit its parent?

You can programatically change height\width with LayoutParams, check this: How to create a RelativeLayout programmatically with two buttons one on top of the other?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM