我正在创建一个 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];
Apple 的通讯录应用。利润率紧张。行与行之间的线。
我的工作应用示例。底部有额外的填充物。行与行之间没有线。
感谢您的任何见解。
最佳答案
试试这个
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];
关于ios - 从 UIActionSheet 弹出窗口中删除填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20907395/