getWindowVisibleDisplayFrame() gives different values in Android 2.2, 2.3 (but not 2.3.3)

前端 未结 4 1241
执笔经年
执笔经年 2021-01-06 03:11

I\'ve got an Activity which uses

getWindow().getDecorView().getWindowVisibleDisplayFrame(rectangle);

to determine the useable

4条回答
  •  礼貌的吻别
    2021-01-06 03:21

    There are times when you need to know the precise dimensions of the available space for a layout when in an activity's onCreate. After some thought I worked out this way of doing it: https://stackoverflow.com/a/16691531/2202013 It does not use getWindowVisibleDisplayFrame and is hopefully future proof.

提交回复
热议问题