2011-06-28 8 views
2

QLPreviewControllerがこれを行うことができます。しかし、それはフルスクリーンです、私の要件は、サブビューのプレビューファイルです。iosでフルスクリーンファイルのプレビューを実装する方法

オフラインウィンドウを使用してQLPreviewControllerを表示し、オフラインウィンドウのスクリーンショットを作成しようとしました。

問題は私がウィンドウを表示しなければならない、そうでなければスクリーンショットは何も捕らえないということです。

私の質問は、iOSでオフラインウィンドウのスクリーンショットを作成する方法です。

また、別の方法でファイルのプレビューを実装する方がよいかもしれません。

ヒントをいただければ幸いです。

答えて

2

QLPreviewControllerはサブビューに入れることができます。

私はそれをspliviewとサブクラス化されたQLPreviewControllerで自己使用します。

@interface DocumentViewController : QLPreviewController <QLPreviewControllerDataSource> 

@implementation DocumentViewController 

... 
- (id)init 
{ 
    self = [super init]; 
    if (self) 
    { 
     self.dataSource = self; 
     self.delegate = self; 
    } 
    return self; 
} 
... 

と実装方法は、あなたが(numberOfPreviewItemsInPreviewControllerは、データソースのために必要とされる)したい魔女

+0

エクセレント:

DocumentViewControllerがQLPreviewControllerのサブクラスである
- (void)tableView:(UITableView *)tView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { DocumentViewController *documentViewController = [DocumentViewController new]; [self.navigationController pushViewController:documentViewController animated:YES]; [documentViewController release]; } 

!できます! –

関連する問題