我正在尝试创建一个带有 3 个文本字段和 3 个标签的 UIAlertView。
但是使用我当前的代码,它们只是相互交叉,我尝试更改 AlertView 的框架,并且尝试使用 CGAffineTransform 但它们都不起作用。
这是我的代码:
UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Sign in" message:@"\n\n\n\n\n" delegate:self cancelButtonTitle:@"Stop" otherButtonTitles:@"Sign in",nil];
UILabel *customerIdLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 55, 65, 21)];
customerIdLabel.tag =1;
customerIdLabel.text = @"Customer id: ";
[myAlertView customerIdLabel];
UITextField *customerIdField = [[UITextField alloc] initWithFrame:CGRectMake(89, 50, 160, 30)];
customerIdField.tag = 2;
customerIdField.placeholder = @"Fill in your customer id";
[myAlertView customerIdField];
然后还有另外两种组合。
这是我尝试过的转换:
CGAffineTransform myTransform = CGAffineTransformMakeScale(1.0, 0.5f);
[myAlertView setTransform:myTransform];
这就是我得到的: