最通常的方法都是在单个activity下的onCreate()里面添加:
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_bar);
然后自己来写layout文件实现title的布局,这样可以实现title居中,但作用域仅仅是这个activity。
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_bar);
然后自己来写layout文件实现title的布局,这样可以实现title居中,但作用域仅仅是这个activity。