Note that there are some explanatory texts on larger screens.

plurals
  1. POChange specific row color uipicker
    primarykey
    data
    text
    <p>i have the following problem: I can change the text color of the rows inside the uipicker but not the text color of the specific row i want, the picker gets all confused and a lot of text labels become blue.</p> <pre><code>- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { UILabel *retval = (UILabel*)view; if (!retval) { retval= [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, [pickerView rowSizeForComponent:component].width, [pickerView rowSizeForComponent:component].height)]; } retval.text = [arraySubSistemasDeSaude objectAtIndex:row]; if(pickerView == subSistemaSaudePicker) { if ([retval.text isEqualToString:@"Seguros de saúde"]) { NSLog(@"ROW=%d",row); [retval setTextColor:[UIColor blueColor]]; } if ([retval.text isEqualToString:@"Sistemas de Saúde e Equiparados"]) { NSLog(@"ROW=%d",row); [retval setTextColor:[UIColor blueColor]]; if ([retval.text isEqualToString:@"Seguradoras-Acidentes de Trabalho, viação/pessoais e vida"]) { NSLog(@"ROW=%d",row); [retval setTextColor:[UIColor blueColor]]; } if ([retval.text isEqualToString:@"Empresas, associações e outras entidades"]) { NSLog(@"ROW=%d",row); [retval setTextColor:[UIColor blueColor]]; } [retval setBackgroundColor:[UIColor clearColor]]; retval.font = [UIFont systemFontOfSize:14]; } } else if(pickerView == horarioPicker) { retval.text =[arrayHorarios objectAtIndex:row]; [retval setBackgroundColor:[UIColor clearColor]]; retval.font = [UIFont systemFontOfSize:14]; } else if(pickerView == examesPicker) { retval.text =[arrayExames objectAtIndex:row]; [retval setBackgroundColor:[UIColor clearColor]]; retval.font = [UIFont systemFontOfSize:14]; } else if(pickerView == consultasPicker) { retval.text =[arrayConsultas objectAtIndex:row]; [retval setBackgroundColor:[UIColor clearColor]]; retval.font = [UIFont systemFontOfSize:14]; }else { assert(NO); } return retval; } </code></pre> <p>Sorry for my bad english,i hope i made myself clear with the question, thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload