X上的Android位图区域仅 [英] Android Bitmap Tile on X Only
本文介绍了X上的Android位图区域仅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用一个位图平铺在水平而已,有没有办法做到这一点,这样只会X上像CSS循环X扩展。 我用下面的code,但该位图瓦水平和垂直:
< XML版本=1.0编码=UTF-8&GT?;
<位图的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:SRC =@可绘制/细条纹
机器人:TILEMODE =回头客
机器人:重力=顶| fill_horizontal
机器人:抖动=真/>
解决方案
下面是解决方案。您可以在code创建BitmapDrawable并指定只有X区块模式 Android的瓷砖位图
I want to use a Bitmap that Tile on the Horizontal only, is there any way to do it, so that it will expand only on X like repeat x on CSS. I using the following code but the bitmap tile Horizontal and vertical :
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/pinstripe"
android:tileMode="repeat"
android:gravity ="top|fill_horizontal"
android:dither="true"/>
解决方案
Here is the solution. You can create BitmapDrawable in code and specify only X tile mode Android Tile Bitmap
这篇关于X上的Android位图区域仅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文