Redeem Now
Read More
Read now

Changing text size and style in action bar


Like me , I guess many of us want to show a different size and styled text in action bar. If you are using ToolBar its fairly easy but for all those old projects that still have Android’s action bar its a pretty hard work. But you can achieve this with the help of CustomView. Yes you can add a CustomView to your action bar. Apply your style on this custom view and add it to the action bar.

So lets create an example, here I want my Action bar title with center gravity and textSize of 15sp.

And its done. But be careful as after this non of your setTitle() function will change the Title of your activity.

. . .


Add Your Comment

Be the first to comment.