改变superview的frame后可以触发该事件

The event can be triggered after change the frame of superview

1.Show a popup when tap a button(KLCPopup)

2.Change the height of contentView(KLCpopup) when tap the 'change frame' button,and change the height successfully

3. Tap  'change frame' button again, I want change the height again, but it does not work.

来源在https://github.com/leogeng/LabProject.git

谁能修好?

我可以修复它,但最好由你来修复。让这个答案更多地介绍如何调试您的应用程序。

经过非常简短的分析后,我在您的按钮操作方法中放置了一个断点,发现它只被调用了一次。所以它不会第二次调整大小,因为按钮根本不起作用。

候选的是按钮正在以交互禁用等方式进行调整,它被另一个视图覆盖以防止触摸事件,或者它的父视图没有正确调整大小以检测触摸。

使用视图调试器后(有一个您可以在运行时使用的图标显示视图层次结构)我可以看到蓝色背景上的黑色按钮,它位于一些尺寸太小的透明背景上,蓝色视图超出范围。

看来您还需要调整蓝色视图的父视图的大小。