我想有一个 RelativeLayout的
类似于下面的链接显示的图像的背景色。忽略黑线在底部图像的一半。
I'd like to have a background color of a RelativeLayout
similar to that of an image shown in the link below. Ignore the black strip in the bottom half of the image.
我不希望使用的图像作为布局的背景。你能给我如何进行的想法?
I don't want to use the image as a background of the layout. Can you give me an idea of how to proceed?
您可以使用渐变。只要你想在选择设置不同梯度。完成!
You can use gradient. Set different gradient in selector as you want. Done!
GradientDrawable.class
这是你想要的,设置颜色。尽情享受吧!
This is what you want, set your colors. Enjoy!
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:bottom="30dp">
<shape android:shape="rectangle" >
<corners
android:topRightRadius="8dip"
android:topLeftRadius="8dip" />
<gradient
android:startColor="#030303"
android:endColor="#3B3B3B"
android:angle="270" />
</shape>
</item>
<item android:top="30dp" >
<shape android:shape="rectangle" >
<corners
android:bottomLeftRadius="8dip"
android:bottomRightRadius="8dip" />
<gradient
android:startColor="#4B5057"
android:endColor="#4B5059"
android:angle="270" />
<size android:height="30dp" />
</shape>
</item>
</layer-list>
上一篇:通过文件Inno Setup的环路和注册的每个.NET的DLL环路、文件、Inno、Setup
下一篇:本地C ++与Android基于Eclipse - 在STDLIB但作品给人错误给人、错误、作品、Android