Hi Forum,
I am a bit confused about initializing views or UIVIEW object / subclasses. I have seen lots of examples and code snippets like below
my question is about the below line <br>
so CGRectZero makes a rectangle frame of the view object (in this case UILable) in the superview...basically a tiiiiinny tinnny ( LOL ) rectangle at the very top right corner of the superview....in all the subsequent lines where the text is massaged and stuff would this text even show? isn't the text label so tiny?? or does it resize itself automatically?
I am a bit confused about initializing views or UIVIEW object / subclasses. I have seen lots of examples and code snippets like below
Code:
- (UILabel *)makeActivityLabelWithText:(NSString *)labelText;
{
UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
label.font = [UIFont systemFontOfSize:[UIFont systemFontSize]];
label.textAlignment = UITextAlignmentLeft;
label.textColor = [UIColor blackColor];
label.backgroundColor = [UIColor clearColor];
label.shadowColor = [UIColor whiteColor];
label.shadowOffset = CGSizeMake(0.0, 1.0);
label.text = labelText;
return label;
my question is about the below line <br>
UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
so CGRectZero makes a rectangle frame of the view object (in this case UILable) in the superview...basically a tiiiiinny tinnny ( LOL ) rectangle at the very top right corner of the superview....in all the subsequent lines where the text is massaged and stuff would this text even show? isn't the text label so tiny?? or does it resize itself automatically?