Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. private void createCustomActionBarTitle()
  2. {
  3.  
  4. this.getSupportActionBar().setDisplayShowCustomEnabled(true);
  5. this.getSupportActionBar().setDisplayShowTitleEnabled(false);
  6.  
  7. LayoutInflater inflater = LayoutInflater.from(this);
  8. View v = inflater.inflate(R.layout.custom_action_bar,null);
  9.  
  10. customBarTitle = (TextView) v.findViewById(R.id.title);
  11.  
  12. this.getSupportActionBar().setCustomView(v);
  13.  
  14. Toolbar parent = (Toolbar) v.getParent();
  15. parent.setContentInsetsAbsolute(0,0);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement