我有这个可绘制资源:
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/bg_stripe"
android:tileMode="repeat"
android:antialias="true"
android:dither="false"
android:filter="false"
android:gravity="left"
/>
此处用作背景:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_world_locked" >
有时一切正常,有时则不然(可绘制资源以其真正的小尺寸显示并且不重复)。为什么?这是安卓的bug吗?我在我的 HTC Desire Android 2.3 上运行此程序。
不幸的是,是的——这是 Android 的 bug。检查这个答案
平铺可绘制有时会拉伸 https://stackoverflow.com/questions/4336286/tiled-drawable-sometimes-stretches/9500334#9500334
简而言之:您应该在 Java 代码中而不是 XML 中设置重复。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)