Button的高宽无故变大了!
16lz
2021-01-26
原文:点击打开链接
问题效果:
设计的xml看起来正常,但真机上跑button变大了!非常纳闷!
因为Holo设置了最小宽和高「 in the system styles.xml resource for Holo.Widget.Button」: button will take up 64x48dip in Android 4.2.
解决很简单设置android:minHeight 和 android:minWidth 为1dp
<span style="color:#555555;"><Button android:id="@+id/sample_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Z" android:padding="6dp"</span><span style="color:#993399;"> android:minHeight="1dp" android:minWidth="1dp"</span><span style="color:#555555;"> android:layout_marginBottom="6dp" android:layout_marginRight="6dp" style="@style/CustomButton" android:textSize="16sp" /></span>
更多相关文章
- Android(安卓)通知栏Notification总结一:基本用法
- Android(安卓)6.0动态权限及跳转GPS设置界面
- Android-EditText属性大全
- android在学习——Menu背景图片,背景色的设置
- Android(安卓)paint类介绍
- Android(安卓)3D开发,OpenGL ES 的使用(一)
- Android设置Settings:PreferenceFragment(2)
- Android动态换肤开源库Colorful发布
- android 动态折线图