gpt4 book ai didi

ios - 长按图像时如何禁用 UIImagePickerController 中的复制/隐藏功能......?

转载 作者:搜寻专家 更新时间:2023-10-31 22:15:26 24 4
gpt4 key购买 nike

enter image description here - 实际上我在用例中使用 UIImagePickerController,如果我长按任何图片,它会显示复制/隐藏选项(如示例图像所示)

   - I dont want the Copy/Hide feature. 

如果你也遇到过,请给我一些建议:)...

提前致谢...iOS Geeks...PLZ 请引用我下面的代码片段...

 ![@IBAction func allPhotosItemButtonPressed(sender: UIBarButtonItem) {
let imagePicker: UIImagePickerController = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
let popOver: UIPopoverController = UIPopoverController(contentViewController: imagePicker)
popOver.presentPopoverFromBarButtonItem(sender, permittedArrowDirections: UIPopoverArrowDirection.Any, animated: true)
}![enter image description here][1]

最佳答案

它的方向问题。 UIImagePickerController 不支持横向模式..

试试这段代码来源::https://gist.github.com/mkeremkeskin/0ed9fc4a2c0e4942e451

- (BOOL)shouldAutorotate {

UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];

if ( orientation == UIDeviceOrientationPortrait
| orientation == UIDeviceOrientationPortraitUpsideDown) {

return YES;
}

return NO;
}

- (NSUInteger)supportedInterfaceOrientations {

return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
UIDevice* device = [UIDevice currentDevice];
if (device.orientation == UIInterfaceOrientationPortraitUpsideDown) {
return UIInterfaceOrientationPortraitUpsideDown;
}
return UIInterfaceOrientationPortrait;
}

关于ios - 长按图像时如何禁用 UIImagePickerController 中的复制/隐藏功能......?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30978793/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com