2017-11-24 1 views
1

몇 주 전, 나는 이것을 Toolbar에 추가했습니다. 스 와이프 탭 레이아웃에 필요합니다. 그러나 APK를 설치하면 왼쪽 상단에 뒤로 화살표가 있습니다.mainActivity Layout의 툴바에서이 화살표를 제거하는 방법은 무엇입니까?

* Click * Here you can see the arrow which should be removed

나는 그것을 제거 할 수있는 방법을 모르겠어요. 너 나 좀 도와 줄 수있어?

다른 레이아웃이나 수업이 필요한 경우 저에게 문의하십시오. 나는 그 질문을 편집 할 것이다.

activity_main.xml 여기

<?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" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<android.support.design.widget.AppBarLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> 

    <android.support.v7.widget.Toolbar 
     android:id="@+id/toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     android:background="?attr/colorPrimary" 
     app:layout_scrollFlags="scroll|enterAlways" 
     app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> 

    <android.support.design.widget.TabLayout 
     android:id="@+id/tabs" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:tabMode="fixed" 
     app:tabGravity="fill"/> 
</android.support.design.widget.AppBarLayout> 

<android.support.v4.view.ViewPager 
    android:id="@+id/viewpager" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" /> 
</android.support.design.widget.CoordinatorLayout> 

그리고

styles.xml 화살표의 존재 감안할 때

<?xml version="1.0" encoding="utf-8"?> 

<resources> 

<style name="MyTheme" parent="MyTheme.Base"> 

</style> 

<style name="MyTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> 
    <item name="windowNoTitle">true</item> 
    <item name="windowActionBar">false</item> 
    <item name="colorPrimary">@color/colorPrimary</item> 
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
    <item name="colorAccent">@color/colorAccent</item> 
</style> 

</resources> 
+0

이 요청하기 전에 답변을 검색 해보세요 발행하지가 보장 setActionBar(yourToolbar)라고 한 후 간단히

getActionBar().setDisplayHomeAsUpEnabled(false); 

전화, 나는 구글에 "안드로이드 액션 바의 화살표 제거"를 입력하고 대답했다 첫 번째 링크에 – barotia

답변

4

, 나는 당신이 설정 있으리라 믿고있어 와이 ToolbarActionBar입니다.

그렇다면 수정이 매우 간단합니다. 당신이 더 널 포인터

관련 문제