我在我的应用程序的 UIWebView 中使用选择标签,但遇到了一些问题。
- 当单击选择框时,会打开 UIPickerView,有什么方法可以禁用它吗?
- 单击选择框时它会丢失,当我再次单击它的位置时它会出现,有什么办法可以阻止它?因为我总是希望它被展示出来。
这是我的代码:
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];