Q
颜色渐变的背景
-3
A
回答
0
这里试试这个在:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="rectangle" >
<gradient
android:angle="90"
android:centerColor="Your Color"
android:endColor="Your Color"
android:startColor="Your Color"
android:type="linear" />
</shape>
0
在/RES /绘制创建gradient.xml:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#FFFFFF"
android:endColor="#00000000"
android:angle="45"/>
</shape>
,并在/RES /布局您main.xml中布局文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/gradient">
</LinearLayout>
您可以通过更换机器人指定角:值和开始/结束颜色通过替换android:startColor和android:endColor
0
制作一个xml文件水库>绘制文件夹命名background.xml和下面编辑:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<gradient
android:type="radial"
android:centerX="50%"
android:centerY="50%"
android:startColor="#FFFF8205"
android:endColor="#FFF7F7F7"
android:gradientRadius="100"/>
</shape>
在activity_main.xml中的文件引用
现在这个作为父布局的背景
<LinearLayout
.......
android:background="@drawable/background">
.....
</LinearLayout>
相关问题
- 1. 渐变颜色背景?
- 2. 为surfaceview设置渐变背景颜色
- 3. 更改背景颜色作为渐变
- 4. 将背景设置为渐变颜色
- 5. IE11渐变颜色在背景
- 6. 逐渐改变背景颜色,所有的颜色不断
- 7. 如果背景渐变,如何将边框颜色更改为背景颜色?
- 8. IE渐变滤镜背景覆盖活动背景颜色
- 9. 将导航栏颜色混合到背景颜色(渐变?)
- 10. 为uibutton背景图像设置渐变颜色(颜色)iphone sdk
- 11. 用颜色渐变更改背景颜色
- 12. R:ggplot背景渐变着色
- 13. 子图背景渐变色
- 14. 的UILabel更改背景颜色逐渐
- 15. 在列表项上悬停背景颜色变化的渐变
- 16. 背景渐变
- 17. 渐变背景
- 18. Safari中的颜色背景中的透明渐变问题
- 19. jQuery的获得背景渐变色
- 20. 带纯色的背景渐变
- 21. 如何改变背景颜色和背景颜色?
- 22. 如何制作更平滑的渐变背景颜色
- 23. 将颜色和渐变应用于QPushButton的背景
- 24. 如何停止重复自身的背景颜色渐变? (css)
- 25. UIButton的背景颜色逐渐变暗触摸下拖动
- 26. 逐渐改变Swift中的背景颜色
- 27. 如何使用平坦颜色的CSS渐变制作背景?
- 28. 什么是Android EditText中背景的默认颜色渐变?
- 29. 带渐变颜色的CSS背景样式
- 30. Android:使用seekbar逐渐改变多个imageview背景的颜色
你尝试过什么到目前为止? –
如果您可以发布您尝试过的一些示例,这将有所帮助,因此我们可以帮助您诊断出现问题的原因。 – theatlasroom