2013-11-21 5 views
1

내 활동에 페이딩 동작 막대 라이브러리를 사용하고 있지만 작업 표시 줄에 맞춤 레이아웃을 설정하는 방법을 찾을 수 없습니다 .i는이 작업 내에서 내 작업 표시 줄에만 드로어 블을 설정할 수 있습니다 라이브러리, 나는 도서관 코드를 보려고했지만 너무 많은 도움이되지 않았다 ............ 어쨌든 그렇게 할 수있다. 여기페이딩 ActionBar Lib에 대한 사용자 레이아웃

는 일반적으로 작동하는 방법이다 :

  FadingActionBarHelper helper = new FadingActionBarHelper() 
     .actionBarBackground(R.drawable.ab_background) 
     .headerLayout(R.layout.header) 
     .contentLayout(R.layout.activity_profile); 

답변

0

FadingActionBar mentiond로 this를보십시오. 간단하고 라이브러리가 어떻게 작동하는지 이해할 수 있습니다.

1

이 시도, 그것은

ActionBar actionBar = getActionBar(); 
    actionBar.setDisplayShowHomeEnabled(false); 
    actionBar.setDisplayShowTitleEnabled(false); 
    actionBar.setDisplayShowCustomEnabled(true); 
    actionBar.setCustomView(actionBarLayout); 

다음 FadingActionbar 코드를 사용하여 작업 표시 줄 & setCustomView을 config (설정) 사용자 정의 작업 표시 줄

final ViewGroup actionBarLayout = (ViewGroup) getLayoutInflater().inflate(
      R.layout.actionbar_layout, 
      null); 

을 팽창 내 옆에서 작동

 FadingActionBarHelper helper = new FadingActionBarHelper() 
    .actionBarBackground(R.drawable.ab_background) 
    .headerLayout(R.layout.header) 
    .contentLayout(R.layout.activity_profile); 
+0

예! 작동합니다. :) –

관련 문제