我在我的应用程序的UIWebView中使用了一个select标签,但遇到了一些问题。
这是我的代码:
webView = [[UIWebView alloc] initWithFrame:cellRectangle];
NSString *content = [NSString stringWithString:@""];
content = [content stringByAppendingString:@"<select style='width:100%; height:100%'>"];
for(int i = 0; i<[seasons count]; i++){
Season *aSeason = [seasons objectAtIndex:i];
content = [content stringByAppendingString:@"<option"];
if(aSeason.n_isCurrent = 1) content = [content stringByAppendingString:@" selected=\"yes\""];
content = [content stringByAppendingString:@">"];
content = [content stringByAppendingString:aSeason.c_Season];
content = [content stringByAppendingString:@"</option>"];
}
content = [content stringByAppendingString:@"</select>"];
webView.backgroundColor = [UIColor clearColor];
webView.scalesPageToFit = NO;
[webView setOpaque:NO];
[webView loadHTMLString:content baseURL:nil];
答案 0 :(得分:1)
只要将任何功能传递给WebView,就无法对该行为进行任何操作。回答您的具体问题:
1)否
2)否
如果您想要一个特定的行为,您必须自己做自定义视图并对其进行适当的编码。