Implement UIButton as follows:
@interface MyNewButton : UIButton{ UILabel* nickNameLabel; UIImageView* myImageView; } @property (nonatomic, retain) UIImageView *myImageView; @property (nonatomic, retain) UILabel* nickNameLabel; @end @implementation MyNewButton @synthesize myImageView; @synthesize nickNameLabel; - (id)initWithFrame:(CGRect)frame { myImageView=[[AXSImageView alloc] initWithFrame:CGRectMake(10, 3, 40, 40)]; [self addSubview:myImageView]; nickNameLabel=[[UILabel alloc] initWithFrame:CGRectMake(myImageView.frame.origin.x + myImageView.frame.size.width + 6, 15, 80, 17)]; [self addSubview:nickNameLabel]; } - (void)drawRect:(CGRect)rect {
UIView, which can also be added to this class as a subtitle using an XIB file, you know what that means :)
source share