更改IOS完成按钮文本

时间:2017-08-13 16:40:18

标签: ios reactjs react-native

如何更改此默认的完成按钮文字?

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];
    });

1 个答案:

答案 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

希望这有帮助