我在一个可绘制的位图xml文件中有以下代码。以及设置为它的linearLayout的背景。
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/background_screen"
android:tileMode="repeat"
android:scaleHeight="10"
android:scaleWidth="10"
/>图像平铺正常,但不能缩放。我必须做什么/修复它才能使其规模化?
谢谢
发布于 2012-06-26 04:03:36
根据我的经验,最好为每个目标密度创建不同大小的位图。这样,您就不必担心这些缩放属性,并在任何设备上都能获得清晰的结果。
没有为BitmapDrawables定义这些比例属性。它们是为ScaleDrawables而存在的,这意味着要扩展另一个可绘制的。看一看:
http://developer.android.com/guide/topics/resources/drawable-resource.html#Scale
https://stackoverflow.com/questions/11195875
复制相似问题