更改IOS完成按钮文本
问题描述:
如何更改此默认完成按钮文本? 更改IOS完成按钮文本
dispatch_async(dispatch_get_main_queue(), ^{
QLPreviewController* cntr = [[QLPreviewController alloc] init];
cntr.delegate = weakSelf;
cntr.dataSource = weakSelf;
if (callback) {
callback(@[[NSNull null], array]);
}
UIViewController* root = [[[UIApplication sharedApplication] keyWindow] rootViewController];
[root presentViewController:cntr animated:YES completion:nil];
});
答
我可以使这项工作的唯一方法是使用self.navigationController.push
代替self.present
,显示你需要还QLPreviewController
继承QLPreviewController
并进行一些修改
#import "CustomPreviewViewController.h"
@implementation CustomPreviewViewController
-(void)viewDidLoad
{
[super viewDidLoad];
[self.navigationItem setHidesBackButton:YES];
[self.navigationItem setLeftItemsSupplementBackButton:YES];
[self.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc]initWithTitle:@"none" style:UIBarButtonItemStyleDone target:nil action:nil]];
}
@end
希望这有助于
哪一类你的viewController是什么?你能提供一些细节吗? –
嗨@ReinierMelian,我实际上创建反应原生方法,并没有太多关于xcode的信息。我认为这个QLPreviewController默认设置完成按钮,但不知道如何改变它。 – Mike
让我知道如果我的答案以某种方式帮助你 –