Help. I create the first application on android and I want to fill the entire screen with one image, and write text and buttons on top of it. I create under Android 5.0. This white toolbar, where it says "WaY", is bothering me. I tried everything that I can, does not go away. How to remove it?

Photo 1

Here is the markup

Photo 2

  • 2
    Markup and code write, please text, not screenshots - pavlofff
  • It is worth noting that the background is set by the android:background attribute for the container, and not like you. - pavlofff
  • @pavlofff, so this attribute sets the color, i.e. What will be the fill, and the src attribute points to the image? Is not it so? - Amandi
  • ImageView is not needed here at all, the background is set by LinearLayout (the main container). You can specify any resource as a background, including an image - pavlofff
  • @pavlofff, oh, thanks) - Amandi

3 answers 3

in res / values ​​/ styles.xml, change the theme from which your theme is inherited to suit you with the ending .NoActionBar

For example:

 <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> 

    You can change the topic and you can still programmatically hide:

     getSupportActionBar().hide(); 

    But better, of course, through the topic

    • This option is used if you need to remove the Toolbar (ActionBar) in only one activity, and not in the entire application. Then the option with the theme does not fit, and this will be the right decision. - pavlofff
    • one
      @pavlofff, personally for my taste is better through the topic, even if only for one activation) The method suggested in the answer seems to me only the simplest and fastest solution to the problem. - YurySPb
    • I mean, activating a few things in the application and only some of them need to remove the Toolbar, then your answer will help solve the problem. - pavlofff
    • @pavlofff, I understand what you want to say, I just express my personal opinion that it is more correct to inherit one from the general theme for the necessary activations and to register there an attribute that hides the toolbar. So it is more difficult, but, in my opinion more correctly. And software concealment seems to me, for some reason, a crutch) - YuriySPb
    • one
      @Artem, create a theme that inherits the theme of the application, indicate there an attribute to hide the toolbar and register this theme for a specific activation in the manifest or onCreate activation, before calling super.onCreate - YuriySPb

    In general, in res / values ​​/ styles.xml, you can always create in addition several themes to choose from (Dark / Light / .NoActionBar, etc.), in which you will write your options / colors (usually used for large va screens in your application).

    After that, you activate the topics you need for a specific screen in the activation:

     protected void onCreate(Bundle savedInstanceState) { setTheme(R.style.НазваниеСозданнойТемы);