1

I need to set background of repeat image. So i have a file repeat_dark_bg.xml in my drawable folder

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/repeat_dark_marked"
    android:tileMode="repeat"
    >
</bitmap>

repeat_dark_marked - image, which i want to repeat. so then i use repeat_dark_bg.xml as background value of my linearlayout. but whats a problem.. when i test my app on device sometimes image repeat_dark_marked repeat, sometimes it scales and resizes to full screen.. i cant understand why sometimes it shows this or that.. any ideas?

3
  • can you post repeat_dark_bg.xml code ? Commented Aug 8, 2012 at 16:27
  • i have posted it.. there is bitmap Commented Aug 8, 2012 at 16:27
  • Same problem here.. Please reply if you got a solution :) Commented Nov 25, 2013 at 14:54

1 Answer 1

0

repeat_dark_marked.png is 9-patch ? make sure you dont have multiple repeat_dark_marked.png or repeat_dark_marked.9.png etc in your drawable folders. Check all drawable-mdpi, drawable-hdpi, drawable-ldpi folders.

Sign up to request clarification or add additional context in comments.

3 Comments

i have copies of this image in each folder : drawable-mdpi, drawable-hdpi, drawable-ldpi, is it wrong?
No, that is fine. Each folder should have its own copy. But do you have any 9-patch file with same name "repeat_dark_marked" ?
no i havent.. i have only 3 images with that name in each folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.