To view Android image resources repeatedly
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android: src="@drawable/back"
android:tileMode="repeat"/>
This is how you define it in XML and set it to BitmapDrawable
in View, etc.
However, with this method, it will appear repeatedly in both horizontal and vertical directions.
How do I avoid repeating horizontally and vertically?
android bitmap
BitmapDrawabledraw=(BitmapDrawable)getResources().getDrawable(R.drawable.draw);
draw.setTileModeX (Shader.TileMode.REPEAT);
https://stackoverflow.com/questions/11934845/android-tilemode-x-or-y-only
Excerpt from
Note:
There was a much easier way.
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android: src="@drawable/back"
android:tileModeX="repeat"/>
© 2024 OneMinuteCode. All rights reserved.