本文介绍了UIImagePickerController如何隐藏翻转相机按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法隐藏UIImagePickerController中的翻转相机按钮?
is there a way to hide the flip camera button inside the UIImagePickerController?
感谢您阅读
!^ _ ^!
thanks for reading!^_^!
推荐答案
我最终使用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如何隐藏翻转相机按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!