Iphone 应用程序中的windows代理方向不工作

Iphone 应用程序中的windows代理方向不工作,iphone,ipad,ios6,Iphone,Ipad,Ios6,我已经添加了一个通知视图作为toast-in-app委托文件,我添加了类代码,如下所示 customView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 54)] autorelease]; [customView setBackgroundColor: UIColorFromRGB(0xda5340)]; UILabel *lb1=[[[UILabel alloc]initWithFrame:CGRectMake(10, 17,

我已经添加了一个通知视图作为toast-in-app委托文件,我添加了类代码,如下所示

customView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 54)] autorelease];
[customView setBackgroundColor: UIColorFromRGB(0xda5340)];
UILabel *lb1=[[[UILabel alloc]initWithFrame:CGRectMake(10, 17, 180, 21)] autorelease];
lb1.text=@"Pet is out of boundary";
lb1.textAlignment = UITextAlignmentCenter;
lb1.textColor=[UIColor whiteColor];
lb1.backgroundColor = [UIColor clearColor];
[customView addSubview:lb1];
[self.window addSubview:customView];
[self.window showToast:customView duration:3.0 position:@"top" ];
我已经将我的ipad应用程序设置为横向,当我在ipad上尝试时,上面的代码仅在iphone上正常工作。它的方向不正确,
customView
被视为垂直。我还添加了以下代码

-(BOOL)shouldAutorotateToInterfaceOrientation:    (UIInterfaceOrientation)interfaceOrientation { 
return YES; 
 } 

-(NSUInteger)supportedInterfaceOrientations{ 
  return UIInterfaceOrientationMaskAll;  
 } 

如果我想添加任何其他代码,请帮助我解决

方向的最简单初始设置是选择
摘要
选项卡并选择方向,如下图所示