Manually inflating custom view yields different layouts for ActionBar custom view
问题 Custom view from resource: // Set up the action bar. final ActionBar actionBar = getActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setCustomView(R.layout.custom_action_bar); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); the result is: Custom view manually inflated: // Set up the action bar. final ActionBar actionBar = getActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); LayoutInflater inflater = (LayoutInflater