Home java status bar android

status bar android

Author

Date

Category

What could be the problem. Status bar does not change color. Those. Why here the status bar is gray, and not changed in the picture, how should there be in the material design?

And here everything is fine

Here is the XML of the first screenshot

& lt; xml version = "1.0" encoding = "UTF-8"? & gt;
   & lt; linearlayout XMLNS: Android = "http://schemas.android.com/apk/res/android"
  Android: id = "@ + id / linearlayout1"
Android: layout_width = "Match_Parent"
Android: Layout_Height = "Match_Parent"
Android: Orientation = "Vertical"
Android: background = "@ Drawable / Fon"
Android: scaletype = "centercrop" & gt;
 & lt; TextView
  Android: layout_width = "wrap_content"
  Android: layout_height = "wrap_content"
  Android: text = "@ string / app_name"
  Android: id = "@ + id / logo"
  Android: Layout_Gravity = "Center_horizontal"
  Android: TextColor = "@ Color / White"
  Android: TextSize = "53dp"
  Android: layout_margintop = "160dp" / & gt;
& lt; button
  Android: id = "@ + id / login"
  Android: layout_height = "60dp"
  Android: layout_width = "140dp"
  Android: Text = "@ String / Login"
  Android: layout_margintop = "150dp"
  Android: Layout_Gravity = "Center_horizontal"
  Android: TextColor = "@ Color / White"
  Android: background = "@ Color / Main"
  Android: OnClick = "OnClick"
  Style = "? Android: attr / borderlessButtonStyle" / & gt;
 & lt; / linearlayout & gt;

and respectively topic:

& lt; resources & gt;
  & lt;! - Base Application Theme. - & gt;
  & lt; Style name = "AppTheme" Parent = "Theme.appCompat.light" & gt;
    & lt;! - Customize Your Theme Here. - & gt;
    & lt; Item name = "ColorPrimary" & gt; @ color / colorprimary & lt; / item & gt;
    & lt; Item Name = "ColorPrimaryDark" & gt; @ color / colorprimarydark & ​​lt; / item & gt;
    & lt; item name = "coloraccent" & gt; @ color / main & lt; / item & gt;
  & lt; / style & gt;
  & lt; style name = "AppTheme2" Parent = "Theme.appCompat.light.noactionBar" & gt; & lt; / style & gt;
& lt; / Resources & gt;

And 1 more question, can I get a button how to round the edges of the button?


Answer 1, Authority 100%

If the first screenshot uses a second style, then try adding attributes from the first style.
Bar status status responds for color

& lt; item name = "colorprimarydark" & gt; @ color / colorprimarydark & ​​lt; / item & gt;

In order for the status bar transparent to do with the API 19 add to the style attribute

& lt; item name = "android: windowtranslucentstatus" & gt; true & lt; / item & gt;

To make the markup to the status of the bar, it must be transparent, and the set must have an attribute

Android: fitssystemwindows = "True"

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions