Martin
Martin

Reputation: 2266

Change LayoutParams of LinearLayout that is inside of RelativeLayout

I have LinearLayout inside of RelativeLayout. I would like to change height of LinearLayout programmatically. I have tried do this with LinearLayout.LayoutParams but I've got an exception. How to solve this problem? Thanks.

Upvotes: 2

Views: 664

Answers (1)

ChristopheCVB
ChristopheCVB

Reputation: 7315

Try with RelativeLayout.LayoutParams as the parent is a RelativeLayout.

The type of the LayoutParams depends on the parent type.

Upvotes: 2

Related Questions