1

The image below says it all.

enter image description here

The them I use for this Activity is :

    <style name="FormActivityTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

and I'm adding the Toolbar like that in my code :

    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.toolbar_underling));

    toolbarTitle.setText("TextTitle");

The xml code is :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
android:layout_width="match_parent" android:layout_height="match_parent"
android:gravity="center_horizontal|center_vertical" >



<android.support.v7.widget.Toolbar android:id="@+id/toolbar_form"
    android:gravity="center"
    android:background="@color/white" android:minHeight="?attr/actionBarSize"
    android:layout_width="match_parent" android:layout_height="wrap_content">

    <TextView android:id="@+id/toolbar_form_title" android:layout_gravity="center"
        android:textSize="22sp" android:textColor="@color/toolbat_title_color"
        android:layout_width="wrap_content" android:layout_height="wrap_content" />

</android.support.v7.widget.Toolbar>

<ScrollView
    android:layout_margin="@dimen/activity_form_margin"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">


// more views

</ScrollView>

What am I doing wrong ? Where does the "invisible" toolbar abode my toolbar comes from ? Thank you!

Mes
  • 1,671
  • 3
  • 20
  • 36
  • do you have a android:fitsSystemWindows="true" elsewhere in your xml? also for api >=19 you can add transparent status bar to move the toolbar view up. see http://stackoverflow.com/questions/29907615/android-transparent-status-bar-and-actionbar – Angel Koh Apr 27 '16 at 16:13
  • No, i'm not using `android:fitsSystemWindows` anywhere in my project. I want a solution for api>=16. Thanks for your answer. – Mes Apr 27 '16 at 16:23

0 Answers0