Home > Java > javaTutorial > body text

How to implement background image color gradient in android

高洛峰
Release: 2017-01-20 15:53:44
Original
2511 people have browsed it

Commonly used, record it.
Rendering:

How to implement background image color gradient in android

First create a new xml file bg_gradient.xml

<?xml version="1.0" encoding="utf-8"?>  
<shape xmlns:android="http://schemas.android.com/apk/res/android" >  
  
    <gradient  
        android:startColor="#55FF0000"   
        android:centerColor="#99A73C3C"  
        android:endColor="#99000000"  
        android:angle="270"  
        />  
  
    <corners android:radius="0dip" />  
  
</shape>
Copy after login

Quote in the layout file

android:background="@drawable/bg_gradient"
Copy after login

More android For related articles on the method of realizing color gradient of background images, please pay attention to the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template