Android Make透明视图的一半 [英] Android Make transparent half of view

查看:61
本文介绍了Android Make透明视图的一半的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使图像按钮像"1"一样重复android xml和位图.

I can make an image button like "1" with android xml and bitmap repeat.

但是我想用android xml使其像"2"(半透明).我该怎么做?

But I want to make it like "2" (half transparent) with android xml. How can I make it?

推荐答案

这是我的项目视图.我要去除纯白色并保持白色条状.半透明条带.

This is my project view. I want remove solid white color and keep white strips. transparent half of strips.

http://i.stack.imgur.com/H5vJi.png

我是我的xml:

<?xml version="1.0" encoding="utf-8"?>

<item>
    <shape>
        <gradient
            android:angle="0"
            android:endColor="#FFFFFFFF"
            android:startColor="#00FFFFFF" />
    </shape>
</item>
<item>
    <bitmap
        android:antialias="true"
        android:dither="true"
        android:filter="true"
        android:src="@drawable/ww"
        android:tileMode="repeat" >
        <shape>
        </shape>
    </bitmap>
</item>

这篇关于Android Make透明视图的一半的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆