Robert
Robert

Reputation: 1192

Something like background-repeat: repeat-x in Android?

I have a question and is this:

In CSS we use background-repeat: repeat-x (or repeat-y) for repeat an image along the page... so, in Android I can use something like that? I wanna use something like that for my android application :)

Upvotes: 2

Views: 5157

Answers (3)

dianakarenms
dianakarenms

Reputation: 2695

Use tileModeX="repeat"...

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

Upvotes: 0

Marko Lazić
Marko Lazić

Reputation: 883

Try whether this suits your needs.

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

Hope this helps and enjoy your work.

Upvotes: 5

petey
petey

Reputation: 17140

  1. Create a bitmapdrawable
  2. set the tilemode with android:tileMode="repeat" (xml) or code myBitmapDrawable.setTileModeXY(...)

Upvotes: 1

Related Questions