0

When use built in Navigation Drawer activity in android studio that includes action bar and my list view when run the app a part from the list view comes under action bar please help to solve the issue

File name app_bar_dept which include the action bar and include layout="@layout/content_dept" that refer to another file named content_dept

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".dept">

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/CustomActionBarTheme">



 <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/CustomActionBarTheme"/>

</android.support.design.widget.AppBarLayout>

    <include layout="@layout/content_dept"/>

    </android.support.design.widget.CoordinatorLayout>

File name content_dept

 <?xml version="1.0" encoding="utf-8"?>
    <android.support.constraint.ConstraintLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".dept"
    tools:showIn="@layout/app_bar_dept">


        <ListView
        android:id="@+id/listview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingTop="30dp"
        android:clipToPadding="false"
        android:scrollbarStyle="outsideOverlay"/>

    </android.support.constraint.ConstraintLayout>

Here the styles file

<resources>


<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat">
    <item name="android:windowActionBarOverlay">true</item>

    <!-- Support library compatibility -->
    <item name="windowActionBarOverlay">true</item>
</style>

<style name="AppTheme.AppBarOverlay" 
parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" 
/>

</resources>

actionbar2

Actionbar

nabeel
  • 21
  • 2
  • please open the actionbar2 and actionbar attachment to see the difference when run the app . I need to keep the action bar and see all items in the list view plz help me – nabeel Dec 29 '18 at 18:34
  • Possible duplicate of [Android AppBarLayout overlaps listview](https://stackoverflow.com/questions/32653767/android-appbarlayout-overlaps-listview) – Matt Ke Dec 30 '18 at 00:42

1 Answers1

0

Try to change from this android:paddingTop="30dp" to this android:marginTop="30dp" in ListView.

MrFisherman
  • 720
  • 1
  • 7
  • 27