在iPad上,新的ios 7 UIActionSheet没有正确显示许多按钮.
不清理UIActionSheet的滚动背景.这些按钮似乎在背景UIActionSheet中冻结.
我的代码:
UIActionSheet *popupQuery = [[UIActionSheet alloc]; for (int i=0; i<[ParamAllList count]; i++) { NSMutableDictionary *Param = [ParamAllList objectAtIndex:i]; [popupQuery addButtonWithTitle:[Param valueForKey:@"name"]]; [[[popupQuery valueForKey:@"_buttons"] objectAtIndex:[[popupQuery valueForKey:@"_buttons"] count]-1] setImage:[UIImage imageNamed:@"add40icon.png"] forState:UIControlStateNormal]; } popupQuery.actionSheetStyle = UIActionSheetStyleAutomatic; [popupQuery showFromRect:Button_Settings.frame inView:Button_Settings.superview animated:YES];
解决方法
这是我的actionSheet代理的解决方法:
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet { actionSheet.backgroundColor = [UIColor whiteColor]; for (UIView *subview in actionSheet.subviews) { subview.backgroundColor = [UIColor whiteColor]; } }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。