(my english is not very well LOL)
i defined a UIView object as a subview, when i change the subview.bounds.size.height, the subview.frame.origin.y changed, is there something wrong in my code?
here is my code:
- (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++;
}
system output:
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}}