I want to have an Action Bar like foursquare. What I want is tabs such as Friends, Explore and Me. Also, above the tabs I want to have a custom layout that includes some buttons such as foursquare logo, Refresh and Check-In in foursquare. I created tabs but I could not change the layout above tabs in ActionBarSherlock. How can I solve this problem?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
To achieve a Foursquare look you do not need to be thinking of creating a layout above the tabs. When using Actionbar Sherlock you only need to worry about:
So, for 1. and 2. it's all about using styles.xml file (should reside in the values folder in the res folder) like so:
For 3. all you need to do is create menu items under menu.xml (should reside in the menu folder (if not there, create one in the res folder)):
The last thing you have to do to see the menu items is use these functions in the activity:
To set your custom action items (refresh, check in, ...) you must override onCreateOptionsMenu(Menu menu) and set your custom menu.
e.g:
File menu/my_menu.xml
Then in your activity (or fragment):
And to be notified when they are selected, just override onOptionsItemSelected(MenuItem item):