面白いことに、このバグはまだ iOS 7.1beta4 に存在します :)
iPhone の実装では表示されず、iPad のみで表示されます...
そして、その起源は非常に奇妙です-UIActionSheetに非常に多くのアイテムがある場合、「ぼやけた」効果が表示されるため、これらをUITableViewのようなコンテナーに配置する必要がありますが、残念ながら、このビューコンテナーは2回配置されます(同じインスタンスではありません) )。したがって、1 つだけを残し、他のものを削除する必要があります。
修正する必要があるもう 1 つのことは、UITableViewの高さです。
私の修正の下に - UIActionSheetDelegate -(void)willPresentActionSheet に実装する:
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet {
if( SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0") ) {
if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ) {
// fix for iOS7 iPad UIActionSheet presentation when content need to scroll
// and scrolled view appears with unnecessary copies, remove not needed ones
// and set proper tableview height too
int count = 0;
for (UIView *subview in actionSheet.subviews) {
if( [subview isMemberOfClass:[UIView class]] ) {
if( ++count == 1 ) {
// process only first view
for( UIView *subsubview in subview.subviews ) {
if( [subsubview isKindOfClass:[UITableView class]] ) {
// fix table view height
UITableView *tableView = (UITableView*)subsubview;
CGRect tableViewFrame = tableView.frame;
tableViewFrame.size.height -= subview.frame.origin.y;
tableView.frame = tableViewFrame;
}
}
} else {
// remove unnecessary view
[subview removeFromSuperview];
}
}
}
}
}
}