答案 0 :(得分:4)
要在{"City":"Seoul"....}
方法中获取状态栏的高度,您可以使用以下内容:
OnCreate
变量int statusBarHeight = 0, totalHeight = 0, contentHeight = 0;
int resourceId = Resources.GetIdentifier ("status_bar_height", "dimen", "android");
if (resourceId > 0) {
statusBarHeight = Resources.GetDimensionPixelSize (resourceId);
totalHeight = Resources.DisplayMetrics.HeightPixels;
contentHeight = totalHeight - statusBarHeight;
}
现在具有您要查找的值。