- (void)viewDidAppear:(BOOL)animated
{
[superviewDidAppear:animated];
NSLog(@"修改前");
[self printViewHierarchy:self.navigationController.navigationBar];
//修改NavigaionBar的高度
self.navigationController.navigationBar.frame=CGRectMake(0, 20, 320, 100);
NSLog(@"\n修改后");
[selfprintViewHierarchy:self.navigationController.navigationBar];
}
- (void)printViewHierarchy:(UIView*)superView
{
staticuintlevel = 0;
for(uinti = 0; i < level; i++){
printf("\t");
}
constchar*className =NSStringFromClass([superViewclass]).UTF8String;
constchar*frame =NSStringFromCGRect(superView.frame).UTF8String;
printf("%s:%s\n", className, frame);
++level;
for(UIView*viewinsuperView.subviews){
[selfprintViewHierarchy:view];
}
--level;
}
网友评论