Reputation: 105
I'm using Fading action bar library in my activity but i can't find a way to set a custom layout to the action bar .i can only set a drawable to my action bar in this library, i tried looking inside libraries code but it didn't help so much ............ is there anyway to do that.
here is how it usually works :
FadingActionBarHelper helper = new FadingActionBarHelper()
.actionBarBackground(R.drawable.ab_background)
.headerLayout(R.layout.header)
.contentLayout(R.layout.activity_profile);
Upvotes: 1
Views: 1252
Reputation: 2427
I use a compatible version for FadingActionBar with the ActionBar Compat library. You can find it on https://github.com/felixWackernagel/FadingActionBar-Compat.
Upvotes: 1
Reputation: 176
try this, it works in my side
inflate your custom action bar
final ViewGroup actionBarLayout = (ViewGroup) getLayoutInflater().inflate(
R.layout.actionbar_layout,
null);
config your action bar & setCustomView
ActionBar actionBar = getActionBar();
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowCustomEnabled(true);
actionBar.setCustomView(actionBarLayout);
then use FadingActionbar code
FadingActionBarHelper helper = new FadingActionBarHelper()
.actionBarBackground(R.drawable.ab_background)
.headerLayout(R.layout.header)
.contentLayout(R.layout.activity_profile);
Upvotes: 1
Reputation: 1841
take a look at this as FadingActionBar mentiond. It's simple and you will understand how the library workds.
Upvotes: 0