2017-08-13 98 views
-1

如何更改此默认完成按钮文本? 更改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]; 
    }); 
+0

哪一类你的viewController是什么?你能提供一些细节吗? –

+0

嗨@ReinierMelian,我实际上创建反应原生方法,并没有太多关于xcode的信息。我认为这个QLPreviewController默认设置完成按钮,但不知道如何改变它。 – Mike

+0

让我知道如果我的答案以某种方式帮助你 –

回答

0

我可以使这项工作的唯一方法是使用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 

希望这有助于