InsetDrawable
A Drawable that insets another Drawable by a specified distance. This is used when a View needs a background that is smaller than the View’s actual bounds.
xml定义如下
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@color/white"
android:insetLeft="8dp"
android:insetRight="8dp" />
inset属性的作用类似边距。
注:使用InsetDrawable为backgroud的View或ViewGroup,其实际内容区大小为显示的drawable区域,不包括inset区域。