0

I have created a custom action bar

XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white">

<TextView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:text="Choose"
    android:textColor="#000000"
    android:id="@+id/mytext"
    android:textSize="18sp" />
 </LinearLayout>

The java code

 android.support.v7.app.ActionBar bar = getSupportActionBar();
    bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
    bar.setCustomView(R.layout.action_layout);

The screenshot

SCREENSHOT

As you can see it leaves a mall black space to the top left of the screen. I don't want it. I want it to be pure white.

What needs to be done to achieve this.

WISHY
  • 11,067
  • 25
  • 105
  • 197

1 Answers1

1

Try to call setDisplayShowHomeEnabled() with false.

http://developer.android.com/reference/android/app/ActionBar.html#setDisplayShowHomeEnabled%28boolean%29

Dario
  • 2,053
  • 21
  • 31