我正在尝试将 UIAlertView 从屏幕中心的默认位置移动到顶部。我正在使用下面的代码,它可以在 iOS 4 上运行,但在 3 上却没有。
有人知道吗?
UIAlertView *newSubscriptionAlertView = [[UIAlertView alloc] initWithTitle:@"Ndrysho abonimin" message:@" " delegate:self cancelButtonTitle:@"Anullo" otherButtonTitles:@"Ruaj", nil]; subscriptionNameField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 22.0)]; subscriptionNameField.text = [[订阅 objectAtIndex:changeCode] title]; subscriptionNameField.autocorrectionType = UITextAutocorrectionTypeNo; subscriptionNameField.autocapitalizationType = UITextAutocapitalizationTypeNone; [subscriptionNameField setBackgroundColor:[UIColor whiteColor]]; [newSubscriptionAlertView addSubview:subscriptionNameField]; [订阅名称字段成为FirstResponder]; [订阅名称字段发布]; CGAffineTransform moveUp = CGAffineTransformTranslate(newSubscriptionAlertView.transform, 0.0, 0.0); [newSubscriptionAlertView setTransform:moveUp]; [newSubscriptionAlertView 显示]; [newSubscriptionAlertView 发布];