2012-04-05 46 views
0

我有一個自定義共享器與ShareKit重定向到我的應用程序的UIViewController做一些操作。通常,我用這個代碼做的iPhoneiPad - 從ShareKit共享器顯示自定義UIViewController

//Create a new snippet with the item to be shared 
Snippet * selectedSnippet = [[Snippet alloc] initWith: item.title :item.text :@"" : 0]; 

//pass the item to the controller 
detailsController.currentSnippet = selectedSnippet; 

//Show view controller with the navigation controller 
[[SHK currentHelper] showViewController: detailsController]; 

這個任務可是這說明我的UIViewController裁剪,我的猜測是因爲它被顯示爲模態窗口,所以我也試過:

[[self navigationController] pushViewController: detailsController animated: YES]; 

而不是最後一行,沒有運氣。我想要的是從我的共享器顯示UIViewController,但使用整個屏幕。

在此先感謝

回答

0

請勿使用[SHK currentHelper]。爲了尋找靈感,看看SHKiOS5Twitter如何呈現其ShareKit 2.0

UI步驟如下:

  1. 檢查,如果沒有ShareKit的菜單,或其他ShareKit的視圖中打開。如果是,關閉它並在關閉通知後繼續。
  2. 找到當前頂視圖控制器,ShareKit 2.0有一個特殊的功能。
  3. 然後簡單地使用UIView的presentViewController:animated:completion:方法