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;
}

 

上一篇:AZ303-VNET


下一篇:2021-07-14热部署