Android tiling images with bitmaps

Android tiling images with bitmaps

Recently I was banging my head trying to figure out how tile an image for the background of a view with a given image. Now for those of you that are familiar with IOS this is a simple one liner: self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed: @"some_image"]]; With android it is not quite that simple. Hidden through pages and pages of documentation and many google searches I finally found something along the lines of: <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@android:id/background"> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/bg_bars_rpt" android:tileMode="repeat" /> </item> </layer-list> And in the xml for the progress bar: <ProgressBar android:id="@+id/lowest_model_score" android:progress="22" android:progressDrawable="@drawable/grey_progress_bar_states" style="@android:style/Widget.ProgressBar.Horizontal" /> The above is essentially used to draw the background of a progress bar view. This still does not work as smoothly as it does in IOS. it produces the following progress bar which seems skewed. See below: ![image](http://imageshack.us/a/img560/6348/snapshot103112957pm.png) VS IOS: !http://imageshack.us/a/img694/6513/snapshot1031121005pm2.png!