답변

0

.

그는 언급 한 라이브러리의 ActionView으로 android.R.id.home을 교체하려고 할 수 있습니다.

보기를 찾기 및 교체 :

private void replaceHomeView(Activity activity){ 
    View homeView; 
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { 
      Resources resources = activity.getResources(); 
      int id = resources.getIdentifier("android:id/home", null, null); 
      homeView = activity.getWindow().getDecorView().findViewById(id); 
     } else { 
      homeView = activity.getWindow().getDecorView().findViewById(R.id.home); 
     } 
    replace(homeView); 

} 

제거하고 홈 아이콘 ImageView 교체 :

private replace(View home){ 
    ViewGroup parent = (ViewGroup) view.getParent(); 
    int homeIndex = parent.indexOfChild(view); 
    ActionView newHome = new ActionView(home.getContext)); 
    newHome.setId(home.getId()); 
    parent.removeView(home); 
    parent.addView(newHome, homeIndex); 
} 

참고 : 나는이에게 자신을 테스트하지 않았습니다.

4

나는 balysv/material-menu 라이브러리를 사용하여 성공적으로 구현했습니다. balysv에 의해하지만 물질 메뉴도 애니메이션의 정의와 ActionBarSherLock 사용할 수 있습니다 14+

ActionView By Markushi

API 레벨을 필요로한다.

가 여기에 네 개의 아이콘이 상태 :

BURGER, 화살표, X, CHECK. 삭제 작업에는 (X, CHECK)를 사용하고 탐색 용 서랍에는 (BURGER, ARROW)을 사용할 수 있습니다. 내가 좋아하는

enter image description here

또 하나의 특징은 누르면 원 애니메이션입니다. 여기서 우리는 눌린 원 애니메이션과 누르지 않은 원 애니메이션 사이에서 선택할 수 있습니다.

enter image description here