我刚刚将我的应用程序更新到iOS 6,TWTweetComposeViewController的SetInitialText功能已经停止工作。作曲家就会一无所获。我正在使用MonoTouch,还有没有人见过这个问题?同样的代码在我的iOS 5设备上仍然可以很好地工作。
发布于 2012-10-01 06:26:57
使用下面的代码,这对我来说是正常工作的:
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已被弃用,但您有解决此问题的示例代码吗?
https://stackoverflow.com/questions/12664099
复制相似问题