How can I get android Honeycomb system's screen width and height?

前端 未结 3 1544
别跟我提以往
别跟我提以往 2020-12-17 05:41

my code:

Display display = activity.getWindowManager().getDefaultDisplay();
DisplayMetrics displayMetrics = new DisplayMetrics();
display.getMetrics(displayM         


        
3条回答
  •  悲哀的现实
    2020-12-17 06:34

    Actually device full screen width=800 and height=1280 (including status bar, title bar). If you run your code to get display size, the system will not include status bar height and title bar height, so you will get height as 1232 (1280-(status bar height + title bar height)).

提交回复
热议问题