【问题标题】:Enabling bookmarking on a UIWebView (to make shortcuts on springboard)在 UIWebView 上启用书签(在跳板上制作快捷方式)
【发布时间】:2010-03-15 14:17:27
【问题描述】:

我不想在我的应用程序的跳板上添加快捷方式。

我遵循的方式是加载 UIWebView,然后尝试添加书签。但我不知道如何添加“+”按钮来为我的 WebView 的内容添加书签...

有没有办法做到这一点?或者有没有其他方法可以通过编程方式在跳板上添加快捷方式?

谢谢。

【问题讨论】:

    标签: iphone uikit uiwebview bookmarks


    【解决方案1】:

    这在 SDK 中是不可能的。将书签图标添加到主屏幕是 Safari 应用程序的一项功能,绝对不会通过UIWebView 暴露出来。

    【讨论】:

      【解决方案2】:

      试试这个:

          //toolbar
      UIToolbar *toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 416, 320, 44)];
      UIBarButtonItem *bookmarkBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:self action:@selector(bookmark)];
          // add btns to the bar
      [toolBar setItems:[NSMutableArray arrayWithObjects:bookmarkBtn,backBtn,etc..., nil]];
      
      // adds the toobar to the view
      [self.view addSubview:toolBar];
      

      以及动作实现:

      -(void)bookmarksBtn
      { [yourView yourAction]; }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-12-06
        • 1970-01-01
        • 2014-04-28
        • 1970-01-01
        • 2016-12-06
        • 2018-01-08
        • 1970-01-01
        相关资源
        最近更新 更多