Discussion Forums  >  Status Bar, Navigation Bar

Replies: 3    Views: 645

tomtom
Aspiring developer
Profile
Posts: 20
Reg: Jan 18, 2011
location unknow...
1,450
12/22/13 02:28 AM (6 years ago)

Solution: Centering Titles in Navigation Bar Android

Hello Everyone,

I saw that some people had posted requesting a solution for centering the navigation bar titles in Android, something that is default in iOS.
Here is the solution.


File: BT_viewUtilities.java
Line: around 142, you'll see this:
//reference to text view in act_title.xml file...
TextView titleText = (TextView) titleView.findViewById(R.id.titleView);
titleText.setText(navBarTitleText);

Change it to:
//reference to text view in act_title.xml file...
TextView titleText = (TextView) titleView.findViewById(R.id.titleView);
titleText.setText(navBarTitleText);
titleText.setGravity(Gravity.CENTER);

Enjoy!
Regards,
Tomtom
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
12/22/13 02:42 AM (6 years ago)
Nice work! Thanks!

Cheers!

-- Smug
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1702
Reg: May 01, 2011
Hopkins, Minnes...
26,220
like
12/22/13 07:18 PM (6 years ago)
Thanks, @tomtom! It is so great to have more Android expertise in the community. The clients are begging for both Android and iOS.
 
benedettoapp
Lost but trying
Profile
Posts: 139
Reg: Jun 22, 2013
Italy
6,340
like
12/04/14 03:05 PM (5 years ago)
can't find this in BT_viewUtilities.java
your solution is 11 months old, did something change in bt v3?
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.