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区域。
本文详细介绍了InsetDrawable在Android开发中如何用于创建比View实际尺寸小的背景,通过XML定义实现背景的内缩效果,并解释了其与边距的区别及实际应用场景。
5196

被折叠的 条评论
为什么被折叠?



