从 UIActionSheet 弹出窗口中删除填充

2024-04-17

我正在创建一个 UIActionSheet 以允许用户拍摄或选择照片。谁能告诉我为什么它的显示与苹果的不一样?这是针对 iPad 的,所以我没有声明取消按钮。

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];

苹果的通讯录应用程序。利润紧张。行与行之间的线。

我的工作应用程序示例。底部有额外的衬垫。行与行之间没有线。

感谢您的任何见解。


Try this

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];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

从 UIActionSheet 弹出窗口中删除填充 的相关文章

随机推荐