我已经包含了 toast 类,当我使用以下代码时,我已将我的应用程序分配为 iphone 中的纵向和 ipad 中的横向
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 showToast:customView duration:3.0 position:@"top" ];
在 iphone 中,它正确地显示在确切的位置。
当我尝试使用 ipad 时,它会像图像中一样垂直显示。
请帮我整理一下。