I am a beginning iPhone developer. I want to create a UILabel programmatically, and I want to know all of the properties and functionality of the UILabel class.
UILabel *label = [[[UILabel alloc] initWithFrame:...] autorelease];
// Do some stuff
[self.view addSubview:label];
UILabel reference: http://developer.apple.com/library/ios/#documentation/uikit/reference/UILabel_Class/Reference/UILabel.html
Use this code.
UILabel *lbl1 = [[UILabel alloc] init];
[lbl1 setFrame:CGRectMake(0,5,100,20)];
lbl1.backgroundColor=[UIColor clearColor];
lbl1.textColor=[UIColor whiteColor];
lbl1.userInteractionEnabled=YES;
[self.view addSubview:lbl1];
lbl1.text= @"TEST";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With