Reputation: 6141
my problem is following : On rotation, my background which is made of repeating pattern changes so that the pattern is stretched instead of repeating. What could possibly be wrong ?
I have this background made of repeating pattern:
< bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/pattern"
android:tileMode="repeat" />
Upvotes: 1
Views: 204
Reputation:
You have to set repeating pattern manually :
parent = (RelativeLayout) findViewById(R.id.log_parent);
Bitmap bg = BitmapFactory.decodeResource(this.getResources(), R.drawable.pattern);
BitmapDrawable patternRepeat = new BitmapDrawable(bg);
patternRepeat.setTileModeX(Shader.TileMode.REPEAT);
patternRepeat.setTileModeY(Shader.TileMode.REPEAT);
parent.setBackgroundDrawable(patternRepeat);
Upvotes: 1