【发布时间】:2014-03-26 01:23:34
【问题描述】:
我想更改 uipickerview 的选择所在行的颜色。还有另一个这样的问题,但唯一的答案是显示如何将 uipickerview 中的所有文本更改为某种颜色。我只是希望在查看器中选择文本时显示不同的颜色。
-(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent: (NSInteger) component reusingView:(UIView *)view
{
NSString *rowItem =[thing objectAtIndex:row];
UILabel *lblRow = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, [pickerView bounds].size.width, 44.0f];
[lblRow setTextColor: [UIColor grayColor]];
[lblRow setTextAlignment:NSTextAlignmentCenter];
[lblRow setText:rowItem];
[lblRow setBackgroundColor:[UIColor clearColor];
return lblRow;
}
【问题讨论】:
标签: iphone uipickerview