【问题标题】:Implementing Sharekit from a button instead of a toolbar从按钮而不是工具栏实现 Sharekit
【发布时间】:2012-11-05 23:30:09
【问题描述】:

我是 sharekit 和 ios 开发的新手。希望在从按钮而不是工具栏实现 sharekit 方面获得一些帮助..

例如,我分享一个链接:

- (IBAction) btnShareClicked :(id)sender;
{
    SHKItem *item = [SHKItem URL:webView.request.URL title:[webView pageTitle]];
    SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
    [actionSheet showFromToolbar:self.navigationController.toolbar];
}

如何更改此示例代码以包含按钮而不是工具栏.. 需要一些指导.. 抱歉,如果这是一个愚蠢的问题...

【问题讨论】:

    标签: ios facebook ios6 uiactionsheet sharekit


    【解决方案1】:
    - (IBAction) btnShareClicked :(id)sender;
    {
         NSString *text = @"Hello";
    
        SHKItem *item = [SHKItem text:text];
        SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];  
        [actionSheet showInView:self.view];
    }
    

    【讨论】:

      【解决方案2】:

      只需查看UIActionSheet 文档...

      例如

      [actionSheet showInView:[sender view];
      

      或:

      [actionSheet showFromRect:[[sender view] frame] inView:[[sender view] superview] animated:YES];
      

      假设发件人是你的按钮,它应该是。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-04-23
        • 1970-01-01
        • 2020-09-10
        • 2015-01-23
        • 1970-01-01
        • 2014-05-02
        • 1970-01-01
        相关资源
        最近更新 更多