Alternative to Dialog.setOnShowListener in Android

2019-08-17 23:46发布

Does anyone have an idea of an alternative to using the new (as of api level 8) Dialog.setOnShowListener. I would like to adjust some things in the calling activity based on the measured height of the dialog, but in order for that to work, I need access to the measured height of the dialog. It works fine in an OnShowListener() callback, but I'd like to find a solution that will work on api level 7.

标签: android
1条回答
beautiful°
2楼-- · 2019-08-18 00:06

The approach I ended up taking was to override the onLayout for the root layout object in my dialog, and then perform my necessary adjustments in there. Works fine.

查看更多
登录 后发表回答