不改变原图的大小但要增加周围空白,其用到的场景很多,我们只拿一个做例子,比如返回按钮,我们习惯了用ImageView,比如:
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="20dp" android:src="@mipmap/back"/>其实也可用TextView,这种方法的范围更大,可以适用图片加文字的展示形式,比如:
<TextView android:layout_width="60dp" android:layout_height="50dp" android:paddingLeft="20dp" android:drawableLeft="@mipmap/back"/>