UIImagePickerController 如何隐藏翻转相机按钮? [英] UIImagePickerController how to hide the flip camera button?

查看:23
本文介绍了UIImagePickerController 如何隐藏翻转相机按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 UIImagePickerController 中隐藏翻转相机按钮?

is there a way to hide the flip camera button inside the UIImagePickerController?

感谢阅读!^_^!

推荐答案

我最终使用 UIImagePickerController 的自定义子类来解决这个(和其他)问题:

I ended up using a custom subclass of UIImagePickerController to fix this (and other) issues:

#import "SMImagePickerController.h"

@implementation SMImagePickerController

void hideFlipButtonInSubviews(UIView *view) {
    if ([[[view class] description] isEqualToString:@"CAMFlipButton"]) {
        [view setHidden:YES];
    } else {
        for (UIView *subview in [view subviews]) {
             hideFlipButtonInSubviews(subview);
        }    
    }    
}    

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];

    hideFlipButtonInSubviews(self.view);
}    

@end

这篇关于UIImagePickerController 如何隐藏翻转相机按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆