Sample code for Android to obtain a variety of width and height information of the screen

This article mainly introduces the sample code for Android to obtain various width and height information of the screen, which is shared with you as follows:

The width and height information contained is shown in the following figure:

Data obtained on simulator:

08-26 07:19:32.712 7834-7834/com.czy.screeninfo E/MainActivity: getTotalScreenHeight 1920 08-26 07:19:33.505 7834-7834/com.czy.screeninfo E/MainActivity: getScreenWidth 1080 08-26 07:19:34.211 7834-7834/com.czy.screeninfo E/MainActivity: getAvailableScreenHeight 1794 08-26 07:19:34.979 7834-7834/com.czy.screeninfo E/MainActivity: getStatusBarHeigh t 63 08-26 07:19:35.580 7834-7834/com.czy.screeninfo E/MainActivity: getVirtualBarHeightIfRoom 126 08-26 07:19:36.340 7834-7834/com.czy.screeninfo E/MainActivity: getVirtualBarHeight 126 08-26 07:19:37.048 7834-7834/com.czy.screeninfo E/MainActivity: getTitleHeight 147

Specific code:

Or you can download the code here: Android gets a variety of width and height information of the screen

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>