0
我剛剛更新我的應用程序到iOS 6,和SetInitialText
功能TWTweetComposeViewController
已停止工作。作曲家只是空着。我正在使用MonoTouch,有沒有其他人看到過這個問題?相同的代碼在我的iOS 5設備上仍能正常工作。iOS6:Twitter的SetInitialText不工作
我剛剛更新我的應用程序到iOS 6,和SetInitialText
功能TWTweetComposeViewController
已停止工作。作曲家只是空着。我正在使用MonoTouch,有沒有其他人看到過這個問題?相同的代碼在我的iOS 5設備上仍能正常工作。iOS6:Twitter的SetInitialText不工作
可正常工作,我用下面的代碼:
var button2 = UIButton.FromType (UIButtonType.RoundedRect);
button2.Frame = new RectangleF (0f, 0f, 300f, 40f);
button2.SetTitle ("Tweet!", UIControlState.Normal);
button2.TouchUpInside += (sender, e) => {
var tvc = new TWTweetComposeViewController();
tvc.SetInitialText ("Here is a tweet...");
tvc.SetCompletionHandler ((result) => {
if (result == TWTweetComposeViewControllerResult.Cancelled) {
Console.WriteLine ("Cancelled sending the tweet!");
} else {
Console.WriteLine ("Tweet sent! hurrah!");
}
this.DismissModalViewControllerAnimated (true);
});
this.PresentModalViewController (tvc, true);
};
View.AddSubview (button2);
即使PresentModal和DismissModal已被棄用,你有問題的示例代碼?
謝謝你的例子,我通過直接實例化TWTweetComposeViewController而不是在新的視圖控制器中實現它來解決問題。 – Zach
隨時將問題標記爲已回答,以便其他人知道問題已成功回覆:) – chrisntr