带有许多按钮的Xcode iPad UIActionSheet无法正确显示iOS7 [英] Xcode iPad UIActionSheet with many buttons do not correctly displayed iOS7
本文介绍了带有许多按钮的Xcode iPad UIActionSheet无法正确显示iOS7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在iPad上,新的ios 7 UIActionSheet没有正确显示,有很多按钮。
On the iPad new ios 7 UIActionSheet is not correctly displayed with lots of buttons.
在滚动时不清除UIActionSheet的背景。按钮似乎在背景UIActionSheet中冻结。
Not cleaning background of UIActionSheet on scrolling. The buttons seem frozen in background 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委托的解决方法:
This was my workaround for the actionSheet delegate:
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet {
actionSheet.backgroundColor = [UIColor whiteColor];
for (UIView *subview in actionSheet.subviews) {
subview.backgroundColor = [UIColor whiteColor];
}
}
基于这个答案:
< a href =https://stackoverflow.com/questions/16163737/change-text-color-in-uiactionsheet-buttons>更改UIActionSheet按钮中的文字颜色
这篇关于带有许多按钮的Xcode iPad UIActionSheet无法正确显示iOS7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文