2012-09-03 68 views

回答

2

首先,你需要添加一個alertView

sheet = [[UIActionSheet alloc] initWithTitle:@"Select Account to Delete" 
             delegate:self 
          cancelButtonTitle:@"Cancel" 
         destructiveButtonTitle:@"Delete All Accounts" 
          otherButtonTitles:@"Add bookmark", @"add to reading", @"add to home screen", nil]; 
    // Show the sheet 
    [sheet showInView:self.view]; 
    [sheet release]; 

,將創建一個彈出視圖(AKA alertview)爲您的圖像上面顯示。至於「添加書籤」或「添加到家裏」,它稍微複雜一些,因爲API沒有爲你提供這樣的功能,你最好的辦法就是用webview以編程方式從Safari瀏覽器啓動Safari。你的應用程序中,並給它的URL

讀到這裏:iPhone SDK - Add a "Add to Home Screen" button in a UIWebView