can anyone tell me how to add two labels for the view that was added to UITableView Cell.i created this view as a UIView with some name. And I created two labels in the UIView class, and also set the frames for the labels, set the text, etc. My problem is that I get this view in a tableview cell, but not with these shortcuts.
countLabel.text = @"4";
countLabel.frame=CGRectMake(275, 10, 20, 15);
countLabel.font=[UIFont boldSystemFontOfSize:15.0];
countLabel.textColor=[UIColor colorWithWhite:0.0 alpha:0.5];
countLabel.backgroundColor=[UIColor clearColor];
hrsLabel.text = @"Hours";
hrsLabel.frame=CGRectMake(260, 30, 45, 15);
hrsLabel.font=[UIFont boldSystemFontOfSize:15.0];
hrsLabel.textColor=[UIColor colorWithWhite:0.0 alpha:0.5];
hrsLabel.backgroundColor=[UIColor clearColor];
it's just that I set the frame, text to shortcuts like this in UIView.and
GreenView *greenView = [[GreenView alloc] initWithFrame:CGRectMake(250, 8, 60, 50)];
greenView.backgroundColor = [UIColor colorWithRed:0.000 green:0.690 blue:0.313 alpha:0.5];
[cell.contentView addSubview:greenView];
and here I add that UIView to tableview cell.and I don’t know how to add these labels to my UIView. please help me.
Sorry if the errors are in English. someone please help me. thanks in advance.
source
share