Reputation: 580
Is there a way where i could add a UILabel
on top of a UIImageView
programmatically ?
So finally there should be a label displayed on top of a Image.
Upvotes: 9
Views: 7271
Reputation: 9453
UIImageView is a subclass of UIView so you can add any UI object onto it.
UILabel *xlabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 50, 20)];
xlabel.text = @"xxx";
[myImageView addSubview:xLabel];
Upvotes: 12