开发者

How to create a custom Picker view controller in iPhone?

开发者 https://www.devze.com 2023-02-14 06:14 出处:网络
开发者_如何转开发I want to create a custom picker view controller. When user selects the particular data in the picker list, then will displayed the check mark image for selected category. How do i se
开发者_如何转开发

I want to create a custom picker view controller. When user selects the particular data in the picker list, then will displayed the check mark image for selected category. How do i set the custom image as selected the category. I have created a label and displayed the contents are in the custom label. But i want to displayed the images only, when selects the category. I have searched for many docs and sample programs in the google. But i didn't get any clear idea. So please help me out.

see my screen shot

How to create a custom Picker view controller in iPhone?

Thanks.


I think that using - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view as I have advised you in the chat room won't help you achieve this UI.

I think that you are better use a UITableView with no separators between cells and place an image above the table so that it will look like a picker.

The problem using a regular UIPicker here is that you want the selected row to move.
In the picker the selected row is the one that is located in the center...


You should add custom view in picker control using below default method :

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view

{

}

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号