Android獲取狀態欄高度

獲取狀態欄高度有兩種方法: 1.若是是在Activity中: Rect localRect = new Rect(); getWindow().getDecorView().getWindowVisibleDisplayFrame(localRect); statusHeight = localRect.top; 限制:因爲getWindow()方法在Activity中
相關文章
相關標籤/搜索