I need to set the height of an imageview as matchparent programatically.if it is a fixed height i know how to set.
but how can i set it as matchparent?
EDIT:
actually height of the parent layout is dynamic.so i need to make the height of the imageview as the height of parent.
For Kotlin Users
Here I used
FrameLayout.LayoutParams
since my views(ImageView
) parent isFrameLayout
The Type of layout params depends on the parent view group. If you put the wrong one it will cause exception.