问题
I have to develop an actionBar with a custom shape for an android app.
The actionBar is a rectangle as always, but every option (icon) I add to the actionBar has to be bigger than the actionBar and with a circle shape.
Any ideas how to implement that feature? I can't find how to solve this problem.
Thanks.
回答1:
I think you should remove the ActionBar completely and make your own custom view with desired content (as mentioned) and put that view on top of each activity.
Customizing action bar to such a limit is i think not possible. and even if it is possible it wont be worth so much effort. So make your own Action bar and it will save you trouble and time.
回答2:
I doubt that can be done using an action bar. The shape and style which you have shown, probably can just be a part of the UI of the activity, with action bar disabled for it.
Something like what you have shown would be a custom View
. You can create a completely custom View class and use that, or make a reusable layout and include it wherever needed using an include tag.
来源:https://stackoverflow.com/questions/25873654/actionbar-android-with-custom-shape