从UIActionSheet Popover中删除填充 [英] Remove Padding from UIActionSheet Popover
本文介绍了从UIActionSheet Popover中删除填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在创建一个UIActionSheet,允许用户拍摄或选择照片。有人能告诉我为什么它不像苹果那样显示出来吗?这是针对iPad的,所以我没有宣布取消按钮。
I am creating a UIActionSheet to allow users to Take or Select a photo. Can someone tell me why it does not display the same as Apple's? This is for the iPad, so I have not declared a Cancel button.
UIActionSheet *actionSheet = [[UIActionSheet alloc] init];
actionSheet.delegate = self;
[actionSheet addButtonWithTitle:NSLocalizedString(@"choosePhotoPopoverButton", @"Choose Photo - Get a photo from the album.")];
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){
[actionSheet addButtonWithTitle:NSLocalizedString(@"takePhotoPopoverButton", @"Take Photo - Use camera to take photo.")];
}
[actionSheet showFromRect:self.imageView.frame inView:self animated:YES];
Apple的联系人应用。利润率很低。行之间的行。
Apple's Contacts app. Tight margins. Line between rows.
我的工作应用示例。底部有额外的填充物。行之间没有行。
My working app example. Extra padding at bottom. No line between rows.
感谢您的任何见解。
推荐答案
试试这个
UIActionSheet *actionSheet;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){
actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate: self cancelButtonTitle:@"" destructiveButtonTitle:nil otherButtonTitles:@"Take Photo",@"Camera", nil];
}else{
actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate: self cancelButtonTitle:@"" destructiveButtonTitle:nil otherButtonTitles:@"Take Photo", nil];
}
[actionSheet showFromRect:self.imageView.frame inView:self animated:YES];
这篇关于从UIActionSheet Popover中删除填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文