android 获取顶部状态栏的高度

val resourceId: Int = activity.resources.getIdentifier("status_bar_height", "dimen", "android")
val statusBarHeight: Int = activity.resources.getDimensionPixelSize(resourceId)

 

posted @ 2020-08-20 18:07  荣超  阅读(3999)  评论(0编辑  收藏  举报