Android5.0 app interface and notification bar integration

Source: Internet
Author: User

Objective:

On the Android5.0 system's mobile phone, the app interface and notification bar can be displayed in an integrated display.

1, First we look at the figure

VALUES-V11 represents the style under this folder on a System version 3.0 phone

VALUES-V21 represents the style under this folder on a system version 5.0 phone

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/03/wKiom1XDKObRAhSYAAEo2W0GwWE566.jpg "title=" 0697a10f-d70d-4835-8c3f-ecf30d7d5033.png "alt=" Wkiom1xdkobrahsyaaeo2w0gwwe566.jpg "/>

2, understand the version of the values of the adaptation, we will next in the VALUES-V21 to add a set of notification bar integration code

Just add Android:colorprimarydark for it to specify the corresponding color code, is it very simple? 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/04/wKiom1XDKe_hPe2ZAAG_J5LCIjU385.jpg "title=" Feb1c033-ce92-4800-8227-d075e3b7da57.png "alt=" Wkiom1xdke_hpe2zaag_j5lciju385.jpg "/>

3, in order to show its effect, we set a simple title layout in the layout interface,

<relativelayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http// Schemas.android.com/tools "android:layout_width=" match_parent "android:layout_height=" match_parent "> <TextV        Iew android:layout_width= "match_parent" android:layout_height= "45DP" android:background= "#ff0000" Android:textcolor= "@android: Color/white" android:textsize= "18SP" android:gravity= "Center" Android : text= "@string/hello_world"/></relativelayout>

4. Apply our defined themes to the app

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/00/wKioL1XDLUbibyu-AAUcT-xTCYk527.jpg "title=" Cc22f2b5-2721-42cb-ba25-876cd2773beb.png "alt=" Wkiol1xdlubibyu-aauct-xtcyk527.jpg "/>5, Next run our app, see the effect

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/04/wKiom1XDK_nRBuRWAADjU-G2lEQ822.jpg "title=" B9091d52-f9fc-4a95-b317-4886c85a1f4e.png "alt=" Wkiom1xdk_nrburwaadju-g2leq822.jpg "/>

How simple it is.


This article is from the "Android_ios" blog, make sure to keep this source http://3048821.blog.51cto.com/3038821/1682346

Android5.0 app interface and notification bar integration

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.