Rect frame = new Rect();
getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
int statusBarHeight = frame.top;
发现网上都这么写的根本都不管用。
super.onCreate(savedInstanceState);
this.setContentView(R.layout.startup);
int height = ActivityUtils.getStatusBarHeight(thiz);
public static int getStatusBarHeight(Activity context){
Rect frame = new Rect();
context.getWindow().getDecorView()
.getWindowVisibleDisplayFrame(frame);
System.out.println("frame=="+frame);
return frame.top;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货