views:

2958

answers:

1

Hi all,

i am using a select tag in a UIWebView in my application but facing with some problems. (maybe they are not the problems but i m soo new for iphone programming)

  1. when the select box is clicked a UIPickerView opens, is there any way to disable it?
  2. when the select box is clicked it gets lost and when i click to its place again it comes up, is there any way to stop this? cause i always want it to be shown.

here is my code:

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

thanx in advance.

+1  A: 

As soon as you pass any functionality off to a WebView, there's not much you can do about the behavior. To answer your specific questions:

1) No

2) No

If you want a particular behavior you'll have to do your own custom view and code it appropriately.

August