如何在qlpreviewcontroller上显示数据

时间:2013-06-28 04:47:37

标签: ios cocoa qlpreviewcontroller

我正在使用qlpreviewcontroller来显示JPG,PNG,PDF和DOCS文件。我的问题是如何在Dropbox应用中显示文件预览?我还想在其上添加导航栏和工具栏。需要帮助......

1 个答案:

答案 0 :(得分:0)

You have to use 
self.navigationcontroller.navigationbar.hidden=NO; //For navigationbar

for Toolbar

NSArray* toolbarItems = [NSArray arrayWithObjects:
        [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd 
                                                      target:self
                                                      action:@selector(your method name:)],
        [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSearch 
                                                      target:self
                                                      action:@selector(your method name:)],
        nil];

    self.toolbarItems = toolbarItems;
    self.navigationController.toolbarHidden = NO;