Android: android:layout_width=wrap_content but not less than X dp?
Asked Answered
S

2

5

Is it possible to define GUI element width as android:layout_width="wrap_content" but somehow define minimal width of Xdp?

Shotton answered 27/7, 2011 at 20:10 Comment(0)
B
12

I believe the attribute you are looking for is android:minWidth. For example,

android:minWidth="10dp"
Bumkin answered 27/7, 2011 at 20:14 Comment(0)
W
3

you can use:

android:minHeight="20dp"
android:minWidth="20dp"

in your xml layout

20dp is a sample value

Wallin answered 27/7, 2011 at 20:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.