if (ipad) {
if (Button) {
UIView *view = (UIView *)Button;
sheet.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController *popover = [sheet popoverPresentationController];
popover.sourceView = view;
popover.backgroundColor = [JSThemeManager colorWithID:KKBackground_04];
if (view.tag == 1000) {
popover.permittedArrowDirections = UIPopoverArrowDirectionUp;
} else {
popover.sourceRect = CGRectMake(view.bounds.origin.x,
view.bounds.origin.y,
view.bounds.size.width + 3,
view.bounds.size.height);
popover.permittedArrowDirections = UIPopoverArrowDirectionUnknown;
}
CGFloat height = number * 72 + 32;
CGFloat width = 219 + 35; // 默认
sheet.preferredContentSize = CGSizeMake(width, height);
} else {
sheet.modalPresentationStyle = UIModalPresentationFormSheet;
}
}
[ViewController presentViewController:sheet animated:YES completion:nil];