Mon problème est ...Comment changer didSelectRow couleur du bleu à l'orange
il est urgent pour moi. s'il vous plaît Merci:
Mon problème est ...Comment changer didSelectRow couleur du bleu à l'orange
il est urgent pour moi. s'il vous plaît Merci:
Essayez ce code: - mettre le code dans la méthode donnée
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UIView *myBackView = [[UIView alloc] initWithFrame:cell.frame];
myBackView.backgroundColor = [UIColor colorWithRed:253.0/256.0 green:199.0/256.0 blue:235.0/256.0 alpha:1.0];// change the color to your orange color i used different color herer
cell.selectedBackgroundView = myBackView;
[myBackView release];
}
ne pas accepter la réponse –
Salut @Aman Merci de me répondre – pinku
UIView *cellBgView = [[UIView alloc] initWithFrame:cell.frame];
cellBgView.backgroundColor = [UIColor orangeColor];
cell.selectedBackgroundView = cellBgView;
[cellBgView release];
Merci de me répondre: – pinku
D'abord, vous devez définir backgroundView
comme d'autres ont dit. Deuxièmement, lorsque la cellule est sélectionnée, elle appellera -(void)setSelected:animated:
et -(void)setHighlighted:animated:
de UITableViewCell
. Je suppose que votre cellule est personnalisée, sous-classe de UITableViewCell
. J'aime remplacer la méthode -(void)setHighlighted:animated:
, et à l'intérieur de la méthode, je vais faire les choses suivantes.
-(void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
{
[myLabel setHighlighted:highlighted];
[myIconImage setHighlighted:highlighted];
///.... propagate the highlighted event to subviews.
// Call super method.
[super setHighlighted:highlighted animated:animated];
}
Acceptez quelques réponses, sinon vous n'allez pas obtenir de réponses à l'avenir ... – visakh7