Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 Fragment 中放置 Sherlock ActionBar?
我已经有了侧导航,所有内容都放在可拖动的片段中。我希望在片段中有 ActionBar,并与片段同时拖动它。
这个怎么做?
解决方案
ActionBar actionBar = getSherlockActivity().getSupportActionBar();
您不会将 ActionBar 放在 SherlockFragment 中。ActionBar 位于 Fragment 之外,在您的SherlockFragmentActivity.
SherlockFragmentActivity