May 2, 2010

[SOLVED] How to center window title

Just put in onCreate


TextView t=(TextView) findViewById(android.R.id.title);
t.setGravity(Gravity.CENTER_HORIZONTAL);





Alternative solution: http://andmobidev.blogspot.com/2010/01/centering-title-of-window.html

Source: Issue 4395 - android - android:gravity property ignored by TextAppearance.WindowTitle or WindowTitle - Project Hosting on Google Code.

No comments:

Post a Comment