开发者

How to display more than two titles in FragmentBreadCrumbs?

开发者 https://www.devze.com 2023-03-12 07:47 出处:网络
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 appre

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();
0

精彩评论

暂无评论...
验证码 换一张
取 消