Right now the title of my activity shows to the left as < Title and then the other menu item shows to the right. I want to center my title and leave out the
I also used actionbar sherlock and i set header position by this method. you can set a custom textview and can set its gravity to center. use the below method and tell me.
private void setHeader(){
LayoutInflater linflater = (LayoutInflater)MainAccountActivity.context.getSystemService(MainAccountActivity.context.LAYOUT_INFLATER_SERVICE);
View GalleryTitleView = linflater.inflate(R.layout.layout_header, null);
galleryTitleTv = (TextView) GalleryTitleView
.findViewById(R.id.GalleryTitleTv);
galleryTitleTv.setText(ITWAppUIConstants.TAB_AGENDA);
ActionBar.LayoutParams lp = new ActionBar.LayoutParams(
ActionBar.LayoutParams.FILL_PARENT,
ActionBar.LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL;
GalleryTitleView.setLayoutParams(lp);
getSupportActionBar().setCustomView(GalleryTitleView);
}
and here is the layout i used: