Timmy Simons
Timmy Simons

Reputation: 599

ActionBar exactly like Facebook app

I want to build a single-line action bar exactly like in fb, with tabs embedded inside the actionbar in form of icons at center so that when user swipes page the next icon is highlighted.

I'm using HoloEverywhere lib which uses actionbarsherlock internally. I'm aware of actionbar customviews but couldnt figure out how to embed tabs inside the customview. Please help . If possible please share code sample

Thanks in advance

enter image description here

Upvotes: 1

Views: 1064

Answers (1)

Lunchbox
Lunchbox

Reputation: 1550

Just create an xml layout that looks like the Facebook action bar, then do something like this:

ActionBar action = getSupportActionBar();
LayoutInflater inflater = getLayoutInflater();
View view = inflater.inflate(R.layout.your_header_xml, null);
action.setCustomView(view);

You just have to make the xml, then it should display fine.

Upvotes: 0

Related Questions