【问题标题】:show initial text as an link in SLComposeViewController在 SLComposeViewController 中将初始文本显示为链接
【发布时间】:2014-02-26 07:32:17
【问题描述】:

我想setinitialtext 以这种方式发布到时间线。它应该像下面这样说,我想为 GlanseApp text only 设置一个 URL

NSString *KSocialSharingTextFBPT=@" Just discovered this great item via [GlanseApp](https://itunes.apple.com/us/app/glanse/id762075664?mt=8) for iPhone"

我怎样才能做到这一点?

这里是分享代码

SLComposeViewController *composeController = [SLComposeViewController 
           composeViewControllerForServiceType:SLServiceTypeFacebook];
[composeController setInitialText:KSocialSharingTextFBPT];
[composeController addImage:image];
[composeController addURL: [NSURL URLWithString:[product objectForKey:@"producturl"]]];
composeController.completionHandler =^(SLComposeViewControllerResult result) {
    switch(result) {
            //  This means the user cancelled without sending the Tweet
        case SLComposeViewControllerResultCancelled:
            break;
            //  This means the user hit 'Send'
        case SLComposeViewControllerResultDone:
            break;
    }
};

【问题讨论】:

    标签: ios iphone social-networking sharing


    【解决方案1】:

    iOS 不像 MacOS 那样支持富文本 (RTF)。唯一直接支持可点击文本链接的 UI 对象是 UIWebView。
    如果对你有帮助,你可以试试This链接。

    【讨论】:

      猜你喜欢
      • 2021-05-26
      • 1970-01-01
      • 2015-07-12
      • 1970-01-01
      • 2020-09-30
      • 2011-05-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多