我想顯示addview我的屏幕的底部,我的應用程序是通用的,所以我在viewDidLoad中使用此代碼爲什麼addview不適合在寬
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
if (orientation == UIDeviceOrientationPortrait || orientation == UIDeviceOrientationPortraitUpsideDown)
{
adView= [[ADBannerView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 80.0f, 320.0f, 40)];
}
else
{
NSLog(@"///////////////////////////// I'm here /////////////////////");
adView= [[ADBannerView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 80.0f, 1024 , 40)];
}
}
else
{
if (orientation == UIDeviceOrientationPortrait || orientation == UIDeviceOrientationPortraitUpsideDown)
{
adView= [[ADBannerView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 40.0f, 320.0f, 40)];
}
else
{
adView= [[ADBannerView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 40.0f, 1024 , 40)];
}
}
[adView setAutoresizingMask: UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin];
//adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
[self.view addSubview: adView];
[self.view bringSubviewToFront:adView];
的問題是,鑑於從未在iPhone上運行,並不能很好的工作填補了寬度在ipad
任何想法如何解決 問候
當然iPad的寬度應該是768或1024。 – ader 2012-02-28 17:06:55
我更新了我的問題,並取決於Apurv我更新了照片 – AMH 2012-02-28 19:07:35