原文:点击打开链接

问题效果:



设计的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>


更多相关文章

  1. Android(安卓)通知栏Notification总结一:基本用法
  2. Android(安卓)6.0动态权限及跳转GPS设置界面
  3. Android-EditText属性大全
  4. android在学习——Menu背景图片,背景色的设置
  5. Android(安卓)paint类介绍
  6. Android(安卓)3D开发,OpenGL ES 的使用(一)
  7. Android设置Settings:PreferenceFragment(2)
  8. Android动态换肤开源库Colorful发布
  9. android 动态折线图

随机推荐

  1. Android应用AsyncTask处理机制详解及源码
  2. android 技术等级
  3. QtAndroid详解(2):startActivity和它的小
  4. android 识别U盘以及读写文件
  5. Android(安卓)Menu中android:showAsActio
  6. Android(安卓)初始化Setup Wizard——Pro
  7. android SD卡学习3-读写文件
  8. Android(安卓)标题栏沉浸式的实现
  9. 【原创】Android(安卓)引用第三方库文件
  10. android (21)