这是一个button
代码: <Button
                android:text="Button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/button1"
                android:padding="0dp"
                android:layout_margin="0dp" />
但是可以看出上下还是有很多间距的,怎么缩小使整个大小刚好包囊住文字?
不能使用固定大小,因为还需要设置图片(android:drawableTop="@drawable/ic_tab_img"),不同设备的尺寸没办法自适应

解决方案 »

  1.   

    android:layout_margin="0dp"给负值、
      

  2.   

    内容间距设不了呀,行间距可以设置。如果觉得系统的不好看,你自己继承View写一个吧
      

  3.   

    padding 为0 都不行,那就只能设负值试试看了。
      

  4.   

    要么不写padding、layout_margin或是赋值为负数,,或是自己自定义。。不要用系统的。。
      

  5.   

    给Button设置自定义的图片背景,图片做成.9.png,做图的时候内边距由黑条的长度来决定!黑条填满整条边,间距就没啦!