qualcuno può dirmi come aggiungere due etichette per una vista che sono stato aggiunto su UITableView Cell.i ho creato quella vista come UIView con qualche nome.e ho creato due etichette nella classe UIView e imposta anche il frame per le etichette, imposta il testo e il problema ecc. Il mio problema è ottenere quella vista nella cella tableview ma non quelle etichette.Aggiunta di etichette come sottoview a UIView
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];
questo è solo io pongo cornice, testo per etichette come che in un 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];
e qui sto aggiungendo che UIView a un cell.and Tableview io non so come aggiungi queste etichette al mio UIView. mi aiuti per favore.
scusa se qualche errore in inglese. per favore qualcuno mi aiuti. grazie mille in anticipo.
Puoi condividere il codice in cui aggiungi le etichette a UIView? –
Aggiungi queste righe, [self.contentView addSubview: countLabel]; [self.contentView addSubview: hrsLabel]; –
Questo codice è in una classe di celle separata ?. Se è così, è necessario assegnare le etichette. –