user3240604
user3240604

Reputation: 417

How to know if device has Navigation Bar

How can I know programmatically if a device has a navigation bar and if it has it how can i get the size (width and height).

I tried this solution stackoverflow.com/a/29938139/1683141 and when I test a Sony Xperia Z on Genimotion, returns that not has a navigation bar but it has!

Please I need to fix this cases with navigation bar, because the app not looks good.

Thanks

Upvotes: 0

Views: 943

Answers (1)

user149408
user149408

Reputation: 5901

Try this answer to the question you linked. The difference between appUsableSize and realScreenSize is the space occupied by the navigation bar. (This works because, somewhat unexpectedly, the status bar counts toward appUsableSize.) If both sizes are the same, you have no navigation bar.

Upvotes: 2

Related Questions