在iPad上,新的ios 7 UIActionSheet无法通过许多按钮正确显示。
滚动时不清除UIActionSheet的背景。这些按钮似乎在后台UIActionSheet中冻结。
screenshot with problem
我的代码:
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];
}
}
基于此答案:
Change Text color in UIActionSheet Buttons
关于ipad - 具有许多按钮的Xcode iPad UIActionSheet无法正确显示iOS7,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19025852/