2

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 :)

4

3 回答 3

5

试试这是否适合您的需求。

<?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" />

希望这对您有所帮助并享受您的工作。

于 2013-05-16T21:43:49.570 回答
1
  1. 创建一个可绘制的位图
  2. 使用(xml) 或代码设置tilemodeandroid:tileMode="repeat"myBitmapDrawable.setTileModeXY(...)
于 2013-05-16T21:42:45.690 回答
0

使用 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" />
于 2017-05-13T00:35:33.410 回答