我想在屏幕底部显示 addview,我的应用程序是通用的,所以我在 viewdidload 中使用此代码
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 中的宽度
任何想法如何解决 最好的问候