替代Dialog.setOnShowListener在Android的API级别7 [英] Alternative to Dialog.setOnShowListener in Android api level 7

查看:176
本文介绍了替代Dialog.setOnShowListener在Android的API级别7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

没有任何人有一个替代的想法,使用新的(如API级别8)Dialog.setOnShowListener。我想调整一些事情的基础上对话的测量高度调用活动,但为了这工作,我需要访问对话框的测量高度。它工作正常,在OnShowListener()回调,但我想找到一个解决方案,将在API级别7工作。

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.

推荐答案

我最终采取的方法是覆盖onLayout在我对话框中的根布局对象,然后在那里履行我必要的调整。工作正常。

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.

这篇关于替代Dialog.setOnShowListener在Android的API级别7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆