在加载数据时,addSubView:loadingView后,发现后面的按钮还可以按,并且响应事件,进而app crash
解决办法就是:在view的Interaction选项中,选中User Interaction Enabled
或者在代码中加:[loadingView setUserInteractionEnabled:YES];
或: loadingView.userInteractionEnabled=YES;
在iOS应用开发中,遇到在加载数据时添加子视图后,按钮仍然可以触发事件并导致应用程序崩溃的问题。通过在视图的交互选项中启用UserInteractionEnabled属性或直接设置为YES,可以解决此问题。本文详细介绍了问题原因及解决方案。
在加载数据时,addSubView:loadingView后,发现后面的按钮还可以按,并且响应事件,进而app crash
解决办法就是:在view的Interaction选项中,选中User Interaction Enabled
或者在代码中加:[loadingView setUserInteractionEnabled:YES];
或: loadingView.userInteractionEnabled=YES;

被折叠的 条评论
为什么被折叠?