wwdc14yh / HyPopMenuView

模仿新浪微博弹出菜单
726 stars 186 forks source link

iOS11 上崩溃 #17

Open zhong-chen opened 6 years ago

zhong-chen commented 6 years ago

点击按钮 崩溃在 HyPopMenuView.m 的 118 行

报错如下: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<popMenvTopView: 0x7fbaed70ca80; frame = (0 44; 375 92); autoresize = W+H; layer = <CALayer: 0x60400042a400>> has been added as a subview to <UIVisualEffectView: 0x7fbaed404a50; frame = (0 0; 375 667); layer = <CALayer: 0x60000003f9a0>>. Do not add subviews directly to the visual effect view itself, instead add them to the -contentView.'

zhong-chen commented 6 years ago

解决了: 在 HyPopMenuView.m 里, 要将那个_backgroundview 的类型由 UIView 变成UIVisualEffectView 然后将所有的[_backgroundview addSubView:xx] 变成 [_backgroundview.contentView addSubView:xx]

luoxiao commented 6 years ago

@zhong-chen 我也改了

puyang0521 commented 6 years ago

iOS 11 动画按钮无法弹出了,请问有没有遇到相同问题的朋友

luoxiao commented 6 years ago

@puyang0521
复制楼上的方案; 解决了: 在 HyPopMenuView.m 里, 要将那个_backgroundview 的类型由 UIView 变成UIVisualEffectView 然后将所有的[_backgroundview addSubView:xx] 变成 [_backgroundview.contentView addSubView:xx]

ZYHB commented 6 years ago

@zhong-chen 我也改了

Easyzhan commented 6 years ago

接楼上 [weakView.backgroundView addSubview:model.customView]; 第158行左右,这里要变成 [weakView.backgroundView.contentView addSubview:model.customView]; 即可解决