我尝试通过UIPopoverController内的UIWebView来打开维基手机版本的网页。问题是,无论我如何设置我的contentSizeForViewInPopover,或只是UIWebView框架,或简单地设置UIWebView.scalesPageToFit = YES。 Wiki移动版本页面的内容大小似乎比我的UIWebView大。但是如果我在iPhone上使用它,就没有这样的问题。这里是我的酥料饼的控制器代码:在UIPopoverController中的UIWebView中显示维基移动页面
//create a UIWebView UIViewController first
WikiViewController *addView = [[WikiViewController alloc] init];
addView.contentSizeForViewInPopover = CGSizeMake(320.0, 480.0f);
//then create my UIPopoverController
popover = [[UIPopoverController alloc] initWithContentViewController:addView];
popover.delegate = self;
[addView release];
//then get the popover rect
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];
,这是我创造的UIWebView代码:
- (void)viewDidLoad
{
wikiWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
wikiWebView.scalesPageToFit = YES;
//or No, doesn't matter, it all get larger than this
wikiWebView.delegate = self;
self.view = wikiWebView;
}
所有代码似乎是典型的... 我想知道如果任何人都可以摆脱我一些光,非常感谢。