其他分享
首页 > 其他分享> > Android 获取系统菜单栏高度

Android 获取系统菜单栏高度

作者:互联网

public int getNavigationBarHeight() {
	Resources resources = getResources();
	int resourceId = resources.getIdentifier("config_showNavigationBar","bool","android");
	if ( resourceId > 0) {
	   if(resources.getBoolean(resourceId)) {//导航栏是否显示
		resourceId = resources.getIdentifier("navigation_bar_height","dimen","android");
		if (resourceId > 0) {
		   return resources.getDimensionPixelSize(resourceId);//获取高度
		}
	   }
	}
	return 0;
}

 

标签:return,int,resourceId,菜单栏,获取,getIdentifier,Android,android,resources
来源: https://blog.51cto.com/u_15298588/3034225