I am trying to open a webpage of a mobile version of a wiki using a UIWebView in a UIPopoverController. the problem is that it doesn't matter how I set my contentSizeForViewInPopover, or just set the UIWebView frame, or just set UIWebView.scalesPageToFit = YES. The page size of the mobile version of the Wiki seems to be larger than my UIWebView. But if I use it on an iPhone, there is no such problem. here is my code for the popover controller:
WikiViewController *addView = [[WikiViewController alloc] init];
addView.contentSizeForViewInPopover = CGSizeMake(320.0, 480.0f);
popover = [[UIPopoverController alloc] initWithContentViewController:addView];
popover.delegate = self;
[addView release];
CGPoint pointforPop = [self.mapView convertCoordinate:selectAnnotationCord
toPointToView:self.mapView];
CGRect askRect = CGRectMake((int)pointforPop.x, (int)pointforPop.y+10, 1.0, 1.0);
[popover presentPopoverFromRect:askRect
inView:self.mapView
permittedArrowDirections:UIPopoverArrowDirectionRight animated:YES];
[self.mapView deselectAnnotation:annotation animated:YES];
and this is my code when creating a UIWebView:
- (void)viewDidLoad
{
wikiWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
wikiWebView.scalesPageToFit = YES;
wikiWebView.delegate = self;
self.view = wikiWebView;
}
the whole code seems typical ... I wonder if anyone can shed some light, thank you very much.
source
share