Reputation: 9914
I made my custom Action Bar, but there is an ugly underline in under it.
You can see the black line under my green actionBar.
my Action Bar xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="0dp"
android:layout_marginTop="4dp" >
<ImageButton
android:id="@+id/menuToggleBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="false"
android:background="@null"
android:scaleType="centerInside"
android:src="@drawable/menu_btn" />
<ImageView
android:id="@+id/loadingIconIv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="@drawable/flexilogo" />
<ImageButton
android:id="@+id/ImageButton01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="false"
android:background="@null"
android:scaleType="centerInside"
android:src="@drawable/menu_btn"
android:visibility="invisible" />
</LinearLayout>
<View
android:id="@+id/view1"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#6ea541" />
And my code::
ActionBar actionBar = getActionBar();
actionBar.setCustomView(R.layout.action_bar);
menuToggleBtn = (ImageButton) actionBar.getCustomView().findViewById(
R.id.menuToggleBtn);
menuToggleBtn.setOnClickListener(this);
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
Why is that black line is there ? I would like to get rid of it. Please help if you can.
E D I T:
I tried to add:
<item name="android:windowContentOverlay">@null</item>.
to my app's style, but it does not work :(
Upvotes: 2
Views: 2471
Reputation: 58
android:layout_height="match_parent" on the LinearLayout tag Should fix it
Upvotes: 3
Reputation: 3856
Hint:
if your app's activity isn't shown in bold in the Windows-View of the hierarchy-perspective, you need to include the ViewServer-component in your app's activity to enable introspection with hierarchyviewer: https://github.com/romainguy/ViewServer
If the hierarchyviewer-connection gets in trouble (maybe due to timeouts) and is non-responding giving errors, reset the adb-connection to your device from the ddms-perspective, Devices-view, menu-item "Reset adb".
Another hint:
You don't have to use a custom-view to show your logo in such a style. To have a drawer-appliance with a logo, look at how to include Google's navigation drawer http://developer.android.com/design/patterns/navigation-drawer.html and how to include your logo as the actionbar-up/drawer-icon http://developer.android.com/guide/topics/ui/actionbar.html#Logo.
Upvotes: 0
Reputation: 912
It can be a shadow... take a look at Remove shadow below actionbar
To remove it you have to make a style and use <item name="android:windowContentOverlay">@null</item>
.
Upvotes: 3