我有一个应用程序。最近几天我尝试为全新的 iOS7 更新它,但当我在我的设备上尝试该应用程序时,我想我发现了一些奇怪的事情(可能是一个错误)。
我花了一整天的时间来找出可能是什么问题,因为在 iOS6 下一切正常。
我的应用程序使用 CGAffineTransformMakeRotation 旋转 textView 及其内容(一些文本)。如果我在 iOS6 中为旋转添加一个浮点值(例如:33.33)仍然可以(就像在过去的美好时光中一样),但在 iOS7 中,textView 的文本会在 textview 的盒子下方和外面(尤其是如果文本对齐是正确的)。
使用下面的代码,任何人都可以测试这种情况:
int textNumber = 1;
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(self.view.frame.size.width/2 - 75, self.view.frame.size.height/2 - 60, 150, 120)];
textView.textColor = [UIColor redColor];
textView.text = @"Valami";
textView.delegate = self;
textView.scrollEnabled = NO;
textView.autocorrectionType = UITextAutocorrectionTypeNo;
textView.userInteractionEnabled = YES;
textView.returnKeyType = UIReturnKeyDefault;
textView.backgroundColor = [UIColor whiteColor];
textView.editable = NO;
textView.tag = textNumber;
textView.textAlignment = UITextAlignmentRight;
[self.view addSubview:textView];
[UIView beginAnimations:@"rotate" context:nil];
[UIView setAnimationDelay: 1.0];
[UIView setAnimationDuration: 3.0];
float res = 13.7657657567;
[self.view viewWithTag:1].transform=CGAffineTransformMakeRotation(res);
[UIView commitAnimations];
如果有人知道这个问题,请帮助我!谢谢!