6.1 Android Framework - BitmapDrawable

本文介绍 Android 中 XML 配置文件中 bitmap 标签的使用方法,详细解释了 android:src、android:antialias、android:dither、android:filter 和 android:gravity 等属性的作用及设置建议。
<?xml version="1.0" encoding="utf-8" ?>
         <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
             android:src="@[package:]drawable/drawable_res"
             android:antialias=["true" | "false"]
             android:dither=["true" | "false"]
             android:filter=["true" | "false"]
             android:gravity=["top" | "bottom" | "left" | "right" | "center_vertical" | "fill_vertical" | "center_horizontal" | "fill_horizontal" | "center" | "fill" | "clip_vertical" | "clip_horizontal" ] />
  • android:src 图片的资源id
  • android:antialias 抗锯齿功能, 应该开启
  • android:dither 放抖动效果, 应该开启
  • android:filter 过滤效果, 当图片被拉伸或压缩时保持较好显示效果, 应该开启
  • android:grarity 图片尺寸小于容器时, 图片摆放的位置
  • android:mipMap 一种纹理技术, 不常用
  • android:tileMode 平铺模式 - disabled clamp repeat mirror
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值