如何在iOS的“快速查看"工具栏中添加自定义按钮? [英] How to add a custom button to the Quick Look toolbar in iOS?

查看:105
本文介绍了如何在iOS的“快速查看"工具栏中添加自定义按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在通过Modal View Controller在iPad上使用Quick Look框架显示PDF文件.效果很好.我的问题是,由于我正在显示PDF文件,因此快速查看"预览会自动添加打印"按钮.我想做的是将打印"按钮替换为自定义的电子邮件"按钮.这是可以做到的吗?一开始我以为这是一件微不足道的事情,但在这一点上我真的很努力.任何帮助将不胜感激.

I'm currently displaying a PDF file using the Quick Look framework on an iPad via the Modal View Controller. Works great. My problem is that since I'm displaying a PDF file the Quick Look preview is automatically adding a "Print" button. What I would like to do is replace the "Print" button with a custom "Email" button. Is this something that can be done? At first pass I thought this was going to be a somewhat trivial thing to do but at this point I'm really struggling with it. Any help would be greatly appreciated.

谢谢

布雷特(Brett)

推荐答案

您可以创建QLPreviewController的子类,例如MyQLPreviewController

you can create a subclass of QLPreviewController like MyQLPreviewController

然后在视图中出现:(BOOL)动画(重要!)

Then in viewWillAppear:(BOOL)animated (IMPORTANT!!)

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    UIBarButtonItem *rightRatain = self.navigationItem.rightBarButtonItem;
    UIBarButtonItem *email = ...;

    self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:right, email, nil];
    [email release];
}

这篇关于如何在iOS的“快速查看"工具栏中添加自定义按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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