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 6529809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:40:48+00:00 2026-05-25T09:40:48+00:00

I have implemented the UIPicker view concept on action sheet, it is working properly

  • 0

I have implemented the UIPicker view concept on action sheet, it is working properly but one thing it is not displaying properly that is row index. There is no highlighted row in the picker view.enter image description here

I have uploaded the image. Please give me the solution for it.

Following is the code which I am using:

-(IBAction)clickformedtype:(id)sender
    {
        UIActionSheet *asheet = [[UIActionSheet alloc] initWithTitle:@"Select medication type" delegate:self
                                                   cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Select", nil];
        [asheet showInView:[self.view superview]]; //note: in most cases this would be just self.view, but because I was doing this in a tabBar Application, I use the superview.
        [asheet setFrame:CGRectMake(0, 117, 320, 383)];
        [asheet release];
    }


    -(void)willPresentActionSheet:(UIActionSheet *)actionSheet {

        medicationtypepicker = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 40, 320, 216)];
        medicationtypepicker.delegate = self;
        medicinetypearray = [[NSMutableArray alloc]initWithObjects:@"ml",@"capsules",@"eyedrops", nil];

        //medicationtypepicker = [[NSMutableArray alloc]initWithObjects:@"ml",@"capsules",@"eyedrops", nil];
        //medicationtypepicker.datePickerMode = ui;

        //Configure picker...
        // [medicationtypepicker setMinuteInterval:1];

        [medicationtypepicker setTag: kDatePickerTag];

        //Add picker to action sheet
        [actionSheet addSubview:medicationtypepicker];

        // [medicationtypepicker release];

        //Gets an array af all of the subviews of our actionSheet
        NSArray *subviews = [actionSheet subviews];

        [[subviews objectAtIndex:SelectButtonIndex] setFrame:CGRectMake(20, 266, 280, 46)]; 
        [[subviews objectAtIndex:CancelButtonIndex] setFrame:CGRectMake(20, 317, 280, 46)];


    }


    - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
    {
        return 1;
    }
    UIPickerView

    - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
    {
        return [medicinetypearray count];
    }

    - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component;
    {
        return [medicinetypearray objectAtIndex:row];
    }

    - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
    {
        medicinetype.text=[medicinetypearray objectAtIndex:row];
        //medicationtypepicker.hidden = YES;

    }

Thanks in advance.

  • 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-05-25T09:40:49+00:00Added an answer on May 25, 2026 at 9:40 am

    Try to set property showsSelectionIndicator to YES:

    medicationtypepicker.showsSelectionIndicator = YES;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented my own RingBuffer , but I'm surprised to see that .NET
I have implemented authentication systems for webapps several times over the years, but before
i have implemented galleryview in one screen named display_image.xml in which i have shown
I have implemented an eclipse plugin that it launches a java application when the
i have implemented a code that fetch single image from 1000+ images. The image
Ok here is my problem. I have a view that loads another view as
I need a PickerView, that behaves like a normal UIPickerView, but only shows one
I have 3 pickers on my view, one of which contains only images. So,
I have implemented quartz scheduler in my application. And its working upto a certain
We have implemented a drag and drop feature that shows a nice simple representation

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.