开发者

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

开发者 https://www.devze.com 2023-03-23 03:46 出处:网络
Is it p开发者_如何学JAVAossible to define GUI element width as android:layout_width=\"wrap_content\" but somehow define minimal width of Xdp?I believe the attribute you are looking for is android:minW

Is it p开发者_如何学JAVAossible to define GUI element width as android:layout_width="wrap_content" but somehow define minimal width of Xdp?


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

android:minWidth="10dp"


you can use:

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

in your xml layout

20dp is a sample value

0

精彩评论

暂无评论...
验证码 换一张
取 消