How to display more than two titles in FragmentBreadCrumbs?
I can see that there is setMaxVisible (int visibleCrumbs) for framen开发者_高级运维tbreadcrumbs but couldn't find any information on how to display more than two titles. Any lead will be highly appreciated.
FragmentTransaction class has a method - setBreadCrumbTitle(int res) - this allows us to add more titles to breadcrumb and should be done for each fragment added to the manager. The value passed to the count method rules on how many titles can be displayed in the bread crumb and it is usually the last N number of titles.
FragmentBreadCrumbs mFragmentBreadCrumbs = new FragmentBreadCrumbs(yourActivity);
mFragmentBreadCrumbs.setMaxVisible(N); //with N>2 in your case.
.. and in each transaction:
FragmentTransaction ft = fragmentManager.beginTransaction();
ft.add(defaultViewId, yourFrag);
ft.setBreadCrumbTitle(yourBreadCrumb);
ft.addToBackStack(null);
ft.commit();
精彩评论