Android UI design tips-making a gradient background, androidui

Source: Internet
Author: User

Android UI design tips-making a gradient background, androidui
Gradient Production

A few days ago, I suddenly found that QQ's default chat background is changing gradually. Then I learned how to make a background color gradient. Here I will summarize it.
  
1. Select the upper and lower colors respectively. Here we use black "#000000", gray "# aaaaaa", white "# ffffff".

2. Create a shape in drawable, define the gradient tag, and define three attributes: startstartColor, centerstartColor, and endstartColor. The angle attribute defines the rotation angle. The type attribute defines the Gradient type of the color.

<shape xmlns:android="http://schemas.android.com/apk/res/android">    <gradient        android:angle="90"        android:centerColor="#aaaaaa"        android:endColor="#000000"        android:startColor="#ffffff"        android:type="linear"></gradient></shape>

3. Call it in background.

Type attribute
  • Linear property value: solution as shown in. The color on the gradient is linear distribution.
  • Radial property value: A gradient from the inside to the outside. When using this property value, you must set the gradientRadius property.

  • Sweep property value: this is a bit unclear, it is a bit like a slice gradient, the specific picture will be clearer

Copyright Disclaimer: This article is an original article by the blogger. You are welcome to repost it. For repost, please describe the source of the article in a conspicuous position and provide a connection.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.