アプリケーションからスプリングボードにショートカットを追加したくありません。
私がフォローしている方法は、UIWebView を読み込んでから、ブックマークを追加しようとしています。しかし、「+」ボタンを追加して WebView のコンテンツをブックマークする方法がわかりません...
そうする方法はありますか?または、プログラムでスプリングボードにショートカットを追加する別の方法はありますか?
ありがとう。
これはSDK内では不可能です。ホーム画面にブックマークアイコンを追加することはSafariアプリの機能であり、を介して公開されることはありませんUIWebView。
これを試して:
//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]; }