2013-04-10 23 views
5

Tôi có nguồn drawable này:TILEMODE lặp lại trong drawable sẽ không làm việc

<?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" 
/> 

sử dụng làm nền ở đây:

<?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" > 

Đôi khi mọi thứ hoạt động tốt, đôi khi không (nguồn drawable xuất hiện trong nó kích thước thật nhỏ và không lặp lại). Tại sao? Đó là lỗi Android? Tôi chạy trên HTC Desire Android 2.3 của tôi.

Trả lời

5

Rất tiếc là có - đó là lỗi Android. Kiểm tra câu trả lời này

Tiled drawable sometimes stretches

Nói tóm lại: bạn nên thiết lập lặp đi lặp lại trong mã Java thay vì XML.

+0

Tôi đã hy vọng nó không phải là một lỗi, dù sao cảm ơn bạn! – VanDir

Các vấn đề liên quan