Я пишу приложение для Android с помощью Navigation Drawer (используйте android.support.v4.widget.DrawerLayout и android.support.v4.app.ActionBarDrawerToggle)
Это снимок экрана с настроенным навигационным индикатором (значком), центрированный по вертикали. 
После того, как я изменил высоту панели действий, индикатор навигации (значок) не центрирован по вертикали. 
Я меняю высоту панели действий в style.xml
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:actionBarStyle">@style/CustomActionBar</item>
<item name="actionBarStyle">@style/CustomActionBar</item>
</style>
<!-- ActionBar styles -->
<style name="CustomActionBar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="android:background">@drawable/actionbar_bar</item>
<item name="android:height">@dimen/action_bar_height</item>
<item name="android:actionBarSize">@dimen/action_bar_height</item>
<!-- Support library compatibility -->
<item name="background">@drawable/actionbar_bar</item>
<item name="height">@dimen/action_bar_height</item>
<item name="actionBarSize">@dimen/action_bar_height</item>
</style>
Как я могу поместить индикатор навигации (значок) в центр по вертикали.
Отредактировано:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dashboard_logged_in);
mContext = this;
final ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME);
actionBar.setCustomView(R.layout.layout_actionbar_login);
initView();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
}
private void initView() {
// DrawerLayout
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerToggle = createDrawerToggle();
mDrawerLayout.setDrawerListener(mDrawerToggle);
// ListView
mDrawerListView = (ListView) findViewById(R.id.left_drawer);
mDrawerAdapter = new DrawerAdapter(this, R.layout.drawer_item_layout, mDrawerList);
mDrawerListView.setAdapter(mDrawerAdapter);
mDrawerListView.setOnItemClickListener(new DrawerItemClickListener());
}
private ActionBarDrawerToggle createDrawerToggle() {
ActionBarDrawerToggle drawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.light_menu_r, R.string.drawer_open, R.string.drawer_close) {
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
//invalidateOptionsMenu();
super.onDrawerSlide(drawerView, 0);
getDrawerToggleDelegate().setActionBarUpIndicator(mContext.getResources().getDrawable(R.drawable.dark_menu_r), R.string.settings);
}
@Override
public void onDrawerClosed(View drawerView) {
super.onDrawerClosed(drawerView);
//invalidateOptionsMenu();
Log.d("Eric Eric", "hahaha");
getDrawerToggleDelegate().setActionBarUpIndicator(mContext.getResources().getDrawable(R.drawable.light_menu_r), R.string.coupon_list);
}
@Override
public void onDrawerSlide(View drawerView, float slideOffset) {
super.onDrawerSlide(drawerView, 0);
}
};
return drawerToggle;
}
Спасибо. Эрик