Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

oxcug

macrumors newbie
Original poster
Oct 3, 2011
24
0
Hey guys how do I add a label to a UIView (separate from the view controller)? And how would I do it for a UIScrollView? Of course this is all via code.
 
Last edited:
Code:
UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(1,1,40,40)];
label1.text =@"BAWSE";
[self.scrollview addSubview:label1];

Something like that, did it out of the head.
It's not that hard..
 
Code:
UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(1,1,40,40)];
label1.text =@"BAWSE";
[self.scrollview addSubview:label1];

Something like that, did it out of the head.
It's not that hard..

Yeah that's what I ended up doing Thanks very much!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.