2017-04-19 19 views
-3

작업 표시 줄의 "<"처럼 보이게하려면 뒤로 버튼을 "< -"과 같이 보이지 않게하고 싶습니다. 제게 어떻게하는지 알려주세요.android에서 작업 표시 줄 버튼을 변경하는 방법

+0

검색을 사용해 보셨습니까? http://stackoverflow.com/questions/13259055/customize-android-action-bar?rq=1 –

+0

중복 : http://stackoverflow.com/a/9265774/5245903 –

+0

지금까지 시도한 내용은 무엇입니까? 귀하의 자바 또는 XML 코드를 게시 – FAT

답변

0

당신에서 활동 onCreate() 방법은이 작업을 수행 :

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 

    ........ 
    ................ 

    getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
    getSupportActionBar().setHomeAsUpIndicator(R.drawable.icon_arrow); 

    .......... 
    ................... 
} 

출력 : 아이콘

enter image description here

는 :

당신이 Android Studio를 사용하는 경우, 당신은 쉽게 아이콘을 추가 할 수 있습니다.

  1. 마우스 오른쪽 버튼으로 사용자의 요구> 다음에 따라 원하는 아이콘을 선택 Clip art
  2. 하는 아이콘 유형 "실행 바 및 탭 아이콘"을 선택> 새> 이미지 자산 당김 폴더에
  3. 변경 테마를
  4. 클릭 클릭
  5. 마침

enter image description here

+0

답장을 보내 주셔서 감사합니다. – Rey

+0

귀하의 경우에 효과가 있는지 알려주세요. – FAT

+0

어디에서 화살표 아이콘을 다운로드 할 수 있습니까 – Rey

0

Fisrt이처럼 YourXmlFile.xml합니다

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:orientation="vertical" 
    android:layout_height="match_parent" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:background="#ffff" 
    android:id="@+id/activity_viewsol" 
    tools:context=".viewsol"> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/linear" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"> 
    <android.support.v7.widget.Toolbar 
    android:id="@+id/toolbar_top" 
    android:layout_height="wrap_content" 
    android:layout_width="match_parent" 
    android:minHeight="?attr/actionBarSize" 
    android:background="@color/colorPrimary" 
    app:theme="@style/ThemeOverlay.AppCompat.Light" 
    android:fitsSystemWindows="true" 
    app:layout_collapseMode="pin" 
    android:elevation="5dp" 
    app:navigationIcon="@drawable/ic_back" //Arrow Back Icon 
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> 
</LinearLayout> 

Toolbar toolbarTop = (Toolbar) findViewById(R.id.toolbar_top); 
    setSupportActionBar(toolbarTop); 
    ActionBar actionBar = getSupportActionBar(); 
    actionBar.setTitle(""); 
    if(actionBar != null) 
     getSupportActionBar().setDisplayHomeAsUpEnabled(true); 

출력 YourFile.Java

이 추가 : enter image description here