打印出View对应的所有子视图

//打印出View对应的所有子视图
- (void)listSubviewsOfView:(UIView *)view {
    
    // Get the subviews of the view
    NSArray *subviews = [view subviews];
    
    // Return if there are no subviews
    if ([subviews count] == 0) return; // COUNT CHECK LINE
    
    for (UIView *subview in subviews) {
        // Do what you want to do with the subview
        NSLog(@"%p",subview);
    }
}

 

posted @ 2016-01-11 14:41  明天日落之前  阅读(251)  评论(0)    收藏  举报