0
如果在WebView中單擊HTML按鈕元素(例如<input type="button">
),我怎樣才能調用iPhone照片庫?任何幫助將不勝感激。在WebView按鈕上調用iPhone照片庫點擊
如果在WebView中單擊HTML按鈕元素(例如<input type="button">
),我怎樣才能調用iPhone照片庫?任何幫助將不勝感激。在WebView按鈕上調用iPhone照片庫點擊
一種方法是然後調用自定義URL像
open:\\imageBrowser
在UIwebViewDelegate抓住這個URL,然後打開圖片庫選擇器:
- (BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
if ([[[request URL] absoluteURL] isEqualToString:@"open:\\imageBrowser"] {
// open the image picker
}
}
一個小評論。您應該使用absoluteString而不是absoluteURL來比較字符串。 – 2011-07-24 15:38:48