(мой английский не очень хорошо LOL)
Я определил объект UIView как подпредставление, когда я изменяю subview.bounds.size.height, изменился subview.frame.origin.y, что-то не так в моем коде?
вот мой код:
- (IBAction)touch
{
static int i = 1;
NSLog(@"%d: Bounds: %@", i, NSStringFromCGRect(self.subView.bounds));
NSLog(@"%d: Frame: %@", i, NSStringFromCGRect(self.subView.frame));
self.subView.bounds = CGRectMake(0.f, 0.f, self.subView.bounds.size.width, self.subView.bounds.size.height + 50);
NSLog(@"%d: Bounds: %@", i, NSStringFromCGRect(self.subView.bounds));
NSLog(@"%d: Frame: %@", i, NSStringFromCGRect(self.subView.frame));
i++;
}
выход системы:
2011-12-23 12:11:29.316 Angry[7959:f803] 1: Bounds: {{0, 0}, {320, 100}}
2011-12-23 12:11:29.318 Angry[7959:f803] 1: Frame: {{0, 0}, {320, 100}}
2011-12-23 12:11:29.319 Angry[7959:f803] 1: Bounds: {{0, 0}, {320, 150}}
2011-12-23 12:11:29.320 Angry[7959:f803] 1: Frame: {{0, -25}, {320, 150}}
2011-12-23 12:11:30.920 Angry[7959:f803] 2: Bounds: {{0, 0}, {320, 150}}
2011-12-23 12:11:30.921 Angry[7959:f803] 2: Frame: {{0, -25}, {320, 150}}
2011-12-23 12:11:30.922 Angry[7959:f803] 2: Bounds: {{0, 0}, {320, 200}}
2011-12-23 12:11:30.923 Angry[7959:f803] 2: Frame: {{0, -50}, {320, 200}}
2011-12-23 12:11:32.080 Angry[7959:f803] 3: Bounds: {{0, 0}, {320, 200}}
2011-12-23 12:11:32.082 Angry[7959:f803] 3: Frame: {{0, -50}, {320, 200}}
2011-12-23 12:11:32.083 Angry[7959:f803] 3: Bounds: {{0, 0}, {320, 250}}
2011-12-23 12:11:32.084 Angry[7959:f803] 3: Frame: {{0, -75}, {320, 250}}