Issue
The black navigation bar on the bottom of the screen is not easily removable in Android. It has been part of Android since 3.0 as a replacement for hardware buttons. Here is a picture:

How can I get the size of the width and the height of this UI element in pixels?
Solution
Try below code:
Resources resources = context.getResources();
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId > 0) {
return resources.getDimensionPixelSize(resourceId);
}
return 0;
Answered By - Sanket
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.