Status bar height in Android 10" tablet -
I want to get the display height of an activity. However, the snippet also includes the height of the status bar in the display height, which can be obtained from the following:
int screenhigh = context.greatresisance (). GetDisplayMetrics () HeightPixels; What do I want to say that the altitude from the top of the screen to the bottom of the navigation bar (eg, Nexus 4) or the bottom edge screen (eg, Samsung Galaxy S4 ) So what I have to do, get height pixels from snippet from top to bottom, and then decreases the height of the status bar int screenHeight =! [Context.getResources () GetDisplayMetrics () HeightPixels] [1]; Int Position BarHeight = 0; Int resourceId = context.getResources (). GetIdentifier ("status_bar_height", "dimen", "android"); If (resourceId> 0) {statusBarHeight = context.getResources () GetDimensionPixelSize (resourceId); } Int displayableHeight = screenHeight - statusBarHeight; This snippet works correctly only on phones and 7 "tablets, but on 10" tablet (which I do not see the status bar anywhere on the screen), the position BarHeight The snippet returns 50px. The user who sees a screen on less than 50px less than the displayable light.
Do you know why the 10 "tablet report does not appear on the screen at the position bar height = 50px, and how can I fix this problem? / P>
Best
You are viewing the dimension, the visual is not its actual height, of course it is hidden when it will not be reset. Areas need to get the values.
Comments
Post a Comment