2017-03-16 1 views
1

두 번째 툴바가 나타나는 이유를 모르겠다 ...두 번 도구/작업 표시 줄을 제거하는 방법?

Activite "ListActivity"에 대한 내 xml 파일을 첨부했습니다.

doublebar 안드로이드 스튜디오에서 콴 티코의 예언자 미리보기에서 사라졌다 XML에서 한 줄을 삭제 한 후

,하지만 난 앱을 실행할 때 두 번째 줄은 여전히 ​​나타납니다 ...

어떻게 제거하기 위해?

enter image description here activity_list.xml

<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" 
android:fitsSystemWindows="true" 
tools:context="ibas.locatixteamviewer.ListActivity"> 

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

    <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/AppTheme.PopupOverlay" /> 

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

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

content_list.xml

<RelativeLayout 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:id="@+id/content_list" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:paddingBottom="@dimen/activity_vertical_margin" 
android:paddingLeft="@dimen/activity_horizontal_margin" 
android:paddingRight="@dimen/activity_horizontal_margin" 
android:paddingTop="@dimen/activity_vertical_margin" 
app:layout_behavior="@string/appbar_scrolling_view_behavior"> 

<android.support.v4.widget.SwipeRefreshLayout 
    android:id="@+id/swipeRefreshLayout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <android.support.v7.widget.RecyclerView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_centerVertical="true" 
     android:layout_centerHorizontal="true" 
     android:id="@+id/itemRecyclerView" /> 

</android.support.v4.widget.SwipeRefreshLayout> 

도움 주셔서 감사합니다!

+0

확인이 [링크] (http://www.androhub.com/android-toolbar/). –

답변

4

ActionBar를 사용 중지해야합니다. 아래 절차를 따르십시오.

style.xml에 테마를 추가

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

활동 태그에 매니페스트 테마를 적용 :

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 
setSupportActionBar(toolbar); 
:
<activity 
    android:name=".MainActivity" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme.NoActionBar"> 

가 마지막에서 onCreate에서 지원 액션 바로 툴바 설정

희망이 도움이됩니다.

+0

잘 설명되어 있습니다. 대답으로 표시하십시오. –

+0

기쁘게 생각합니다. 답변을 수락 한 것으로 표시 할 수도 있습니다. :) – tahsinRupam

2

테마 ActionBar를 제거해야합니다. 당신의 활동이 테마를 사용

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
     <item name="windowActionBar">false</item> 
     <!--<item name="windowActionModeOverlay">true</item>--> 
</style> 

매니페스트에 :

<application 
     android:allowBackup="true" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" 
... 
관련 문제