iOS6:Twitter SetInitialText 不起作用

标签 ios twitter xamarin.ios ios6

我刚刚将应用程序更新到 iOS 6,TWTweetComposeViewControllerSetInitialText 函数已停止工作。 Composer 只是空虚。我正在使用 MonoTouch,有其他人看到过这个问题吗?相同的代码在我的 iOS 5 设备上仍然可以正常工作。

最佳答案

使用以下代码,这对我来说按预期工作:

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 已被弃用,您是否有该问题的示例代码?

关于iOS6:Twitter SetInitialText 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12664099/

相关文章:

c# - Xamarin.iOS 中的静音(iOS 版本 >11)

ios - 如何对 tableview 行执行操作以及如何在其中添加添加披露指示符?

python - tweepy api.me() 不返回 friend 的用户对象

ios - 自定义后退按钮有额外的不需要的空间

ios - 使用 gtm-oauthauthentication 发布推文

twitter - 如何仅使用提及 ID 链接到 Twitter 状态?

c# - Xamarin iOS - MKPinAnnotationView.Image 不显示自定义图像

ios - Swift 2 - 调用中的额外参数

ios - Xcode:无法检查应用程序包

ios - 如何将今天的日期减去18年