UIPickerView行颜色 [英] UIPickerView Row Color

查看:121
本文介绍了UIPickerView行颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何从iPhone SDK的UIPickerView控件中更改行(或行背景)的颜色?类似下面的标题为row,但是我也想改变行的颜色:

Does anyone know how to change the color of a row (or row background) in the UIPickerView control from the iPhone SDK? Similiar to the below title for row, however I would also like to change the color of the row:

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component;

谢谢。

推荐答案

您可以在委托的-pickerView:viewForRow:forComponent:reusingView:method中返回任意视图,记录此处

You can return an arbitrary view in the delegate's -pickerView:viewForRow:forComponent:reusingView: method, documented here.

这篇关于UIPickerView行颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆