Inset Drawable

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:
<inset>
Defines the inset drawable. This must be the root element.

attributes:

xmlns:android
StringRequired. Defines the XML namespace, which must be  "http://schemas.android.com/apk/res/android".
android:drawable
Drawable resourceRequired. Reference to a drawable resource to be inset.
android:insetTop
Dimension. The top inset, as a dimension value or  dimension resource
android:insetRight
Dimension. The right inset, as a dimension value or  dimension resource
android:insetBottom
Dimension. The bottom inset, as a dimension value or  dimension resource
android:insetLeft
Dimension. The left inset, as a dimension value or  dimension resource
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:





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值