简体   繁体   English

有没有办法在调度后获取现有的窗口插图?

[英]Is there a way to get existing window insets after dispatch?

Is there a way to fetch an activity's WindowInsets at will, long past the activity's creation, without holding on to it or otherwise caching it?有没有办法WindowInsets获取活动的WindowInsets ,早于活动的创建,而无需保留它或以其他方式缓存它?

eg.例如。

WindowInsets insets = getWindow().getWindowInsets();
myUseCaseView.setPaddingTop(insets.getSystemWindowInsetTop);

Yes: getWindow().getDecorView().是的: getWindow().getDecorView(). getRootWindowInsets()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM