2010-03-15 44 views
1

我不想在我的應用程序的跳板上添加快捷方式。在UIWebView上啓用書籤(在跳板上製作快捷鍵)

我跟隨的方式是加載一個UIWebView,然後嘗試添加書籤。但我不知道如何添加「+」按鈕書籤我的WebView的內容...

有沒有辦法做到這一點?或者有另一種方法來在編程上在跳板上添加快捷方式?

Thanx。

回答

1

這在SDK中不可行。將書籤圖標添加到主屏幕是Safari應用程序的一項功能,絕對不會通過UIWebView曝光。

0

試試這個:

//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]; }