Inset Drawable
A drawable defined in XML that insets another drawable by a specified distance.This is useful when a View needs a background that is smaller than the View's actual bounds.
-
FILE LOCATION:
-
res/drawable/filename.xml
The filename is used as the resource ID.
COMPILED RESOURCE DATATYPE:
-
Resource pointer to a
InsetDrawable
.
RESOURCE REFERENCE:
-
In Java:
R.drawable.filename
In XML:@[package:]drawable/filename
SYNTAX:
-
<?xml version="1.0" encoding="utf-8"?> <inset xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/drawable_resource" android:insetTop="dimension" android:insetRight="dimension" android:insetBottom="dimension" android:insetLeft="dimension" />
-
ELEMENTS:
- EXAMPLE:
-
<?xml version="1.0" encoding="utf-8"?> <inset xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/background" android:insetTop="10dp" android:insetLeft="10dp" />
SEE ALSO:
-