我不想在应用程序的跳板上添加快捷方式。
我遵循的方法是加载一个UIWebView,然后尝试添加一个书签。但是我不知道如何添加"+“按钮来为我的WebView内容添加书签……
有没有办法做到这一点?或者,是否有其他方法可以通过编程方式在跳板上添加快捷键?
谢谢。
发布于 2010-03-15 22:26:16
这在SDK中是不可能的。将书签图标添加到主屏幕是Safari应用程序的一项功能,绝对不会通过UIWebView公开。
发布于 2013-05-22 13:26:57
试试这个:
//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]; }https://stackoverflow.com/questions/2447753
复制相似问题