android获取状态栏高度时间:2023-03-09 20:15:48 获取android屏幕上状态栏的高度方法网上很多这里不再敖述,只举一个例子 Rect rect = new Rect();getWindow().getDecorView().getWindowVisibleDisplayFrame(rect); rect.top便是状态栏的高度。 上面的rect.top为0 的原因是:不能在onCreate() , onResume() , onStart()里面使用。 在布局文档里面最外层的layout不能写成fill_parent