Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8869421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:28:47+00:00 2026-06-14T17:28:47+00:00

As seen image below, I am trying to customize my picker. I have successfully

  • 0

As seen image below, I am trying to customize my picker. I have successfully added images on my picker but not affected all other pickers. I have put my code as well for reference.

- (void)loadView
{
    picker1 = [[UIPickerView alloc] initWithFrame:CGRectMake(30, 200, 250, 250)];
    picker1.delegate = self;
    picker1.dataSource = self;
    picker1.showsSelectionIndicator = YES;
    
    
    
    picker2 = [[UIPickerView alloc] initWithFrame:CGRectMake(390, 200, 250, 250)];
    picker2.delegate = self;
    picker2.dataSource = self;
    picker2.showsSelectionIndicator = YES;
    
    
    picker3 = [[UIPickerView alloc] initWithFrame:CGRectMake(750, 200, 250, 250)];
    picker3.delegate = self;
    picker3.dataSource = self;
    picker3.showsSelectionIndicator = YES;
   
    self.view = [[UIView alloc] initWithFrame:CGRectZero];
    [self.view addSubview:picker1];
    [self.view addSubview:picker2];
    [self.view addSubview:picker3];
    
    
    UIImage *seven = [UIImage imageNamed:@"seven.png"];
    UIImage *bar = [UIImage imageNamed:@"bar.png"];
    
    
    for(int i=1; i<=4; i++)
    {
        UIImageView *sevenView = [[UIImageView alloc] initWithImage:seven];
        UIImageView *barView = [[UIImageView alloc] initWithImage:bar];
        
        
        NSArray *imageViewArray = [[NSArray alloc] initWithObjects:
                                   sevenView,barView,nil];
        
        NSString *fieldName = [[NSString alloc] initWithFormat:@"column%d",i];
        [self setValue:imageViewArray forKey:fieldName];
    }

}


-(UIView *)pickerView:(UIPickerView *)pickerView
           viewForRow:(NSInteger)row
         forComponent:(NSInteger)component reusingView:(UIView *)view
{
    NSString *arrayName = [[NSString alloc] initWithFormat:@"column%d",component+1];
    NSArray *array = [self valueForKey:arrayName];
    return [array objectAtIndex:row];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
}


- (void)dealloc {
    
}

#pragma mark UIPickerViewDelegate methods

- (NSString*)pickerView:(UIPickerView*)pv titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
    return [NSString stringWithFormat:@"%d",row];
}

#pragma mark UIPickerViewDataSource methods

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView*)pv
{
    return 4;
}


- (NSInteger)pickerView:(UIPickerView*)pv numberOfRowsInComponent:(NSInteger)component
{
    return 2;
}

@end

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:28:48+00:00Added an answer on June 14, 2026 at 5:28 pm
    -(UIView *)pickerView:(UIPickerView *)pickerView
               viewForRow:(NSInteger)row
             forComponent:(NSInteger)component reusingView:(UIView *)view
    {
    
        NSArray *array = nil;
    
        if (pickerView == picker1) {
    
            array =  [self valueForKey:@"column1"];
        }
        else if (pickerView == picker2) {
    
            array =  [self valueForKey:@"column2"];
        }
        else if (pickerView == picker3) {
    
            array = [self valueForKey:@"column3"];
        }
    
        return [array objectAtIndex:row];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i will show you an image below but before that... if you have seen
From the image below. It can be seen that I have three table User,
I'm trying to do something as seen on the image is given below, Just
Can you see this tag: <Image Source={Binding Image} Stretch=UniformToFill/> But below? What I'm trying
Has anyone seen any image deskew algorithms in c#? I have found: http://www.codeproject.com/KB/graphics/Deskew_an_Image.aspx but
I have seen this effect where when mouse is over an image, that image
BACKGROUND-IMAGE: url(../images/feedback_trans_tab.png); _background-image: url(../images/feedback_tab_ie6.png) I've seen code like this in a css file feedback_tab_ie6.png
I gave up on trying to center an image vertically and horizontally. I seen
I have a script that uploads an image using JavaScript, as seen here .
Okay so I have been trying to style my users Gravatar image. The problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.