View UIView.m
UIView *newView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 35)]; | |
newView.backgroundColor=[UIColor redColor]; | |
UITextView *mytext = [[UITextView alloc] initWithFrame:CGRectMake(5.0, 0.0, 100.0, 28.0)]; | |
mytext.backgroundColor = [UIColor clearColor]; | |
mytext.textColor = [UIColor blackColor]; | |
mytext.editable = NO; | |
mytext.font = [UIFont systemFontOfSize:15]; | |
mytext.text = @"Mytext"; | |
mytext.scrollEnabled=NO; |
View listSubviews.m
- (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(@"%@", subview); |