In the attached image, I want the column of buttons to match the height of the image, but I also want there to be a minimum height for the column of buttons.
It correctly matches the height of the image, but does not respect the minHeight, and will smoosh the buttons down.
I am setting these properties for the column of buttons:
<LinearLayout
...
android:layout_alignTop="@+id/image"
android:layout_alignBottom="@+id/image"
android:minHeight="150dp"
>
Tricky question because it calls TextView.setMinHeight — but then you are not using a TextView.
So generally
android:minHeight
does indeed do something but not in your particular case.I don't know all your exact requirements, but it seems you can solve this with another layer pretty much like in your diagram. Set the
minHeight
on an outer layout and then justfill_parent
/match_parent
on the inside. Maybe something like:Although my other answer is still valid, nowadays we have the benefit of
ConstraintLayout
. I'm sure the original poster has long since gotten past this problem, but for future users' sake: you can achieve the same result without the extra layer ofViewGroup
s. Something like this:Possibly you may need something like:
for the
ImageView
to handle larger images, but I haven't tested it.