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

  • Home
  • SEARCH
  • 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 4057586
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:58:18+00:00 2026-05-20T14:58:18+00:00

I have a situation here please help me out in this, 1) I have

  • 0

I have a situation here please help me out in this,

1) I have a Table with custom cells
2) Each cell has 2 search bars and 2 lables.

what I was attempting is suppose a user beginEditing a searchBar a popover should appear pointing that search bar.

I have implemented this but popover is not appearing over the desired searchBar moreover height of popover is also too long sometime

if (searchBar.tag==10) {
    NSLog(@"Display date popover");
    CGRect pickerFrame = CGRectMake(0,0,300,200);

    UIViewController *tempDateViewController=[[UIViewController alloc] init];

    UIDatePicker *datePicker = [[UIDatePicker alloc] initWithFrame:pickerFrame];

    [datePicker addTarget:self action:@selector(pickerChanged:) forControlEvents:UIControlEventValueChanged];

    [tempDateViewController.view addSubview:datePicker];

    if(!currentPopover)
    {

        currentPopover=[[UIPopoverController alloc] initWithContentViewController:tempDateViewController];
    }
    else {

        [currentPopover setContentViewController:tempDateViewController animated:YES];

    }

    tempDateViewController.contentSizeForViewInPopover=CGSizeMake(320, 300);
    [datePicker release];
    [tempDateViewController release];
    [currentPopover presentPopoverFromRect:searchBar.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];



}   

Please help me to solve this one.
Thanx 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-20T14:58:19+00:00Added an answer on May 20, 2026 at 2:58 pm

    The searchBar is inside a cell which is in a table view (which may be in some other view depending on your layout). The problem most likely is that self.view is not the direct parent of searchBar where you are calling this. So using the frame of the searchBar in self.view will give unexpected results.

    Instead of using self.view and trying to figure out where the searchBar is relative to that, you can use the searchBar itself for the “inView” and for the “rect”, use the searchBar’s bounds:

    [currentPopover presentPopoverFromRect:searchBar.bounds inView:searchBar 
        permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    

    Next, to fix the height of the popover, try setting the popover’s popoverContentSize instead of the view controller’s contentSizeForViewInPopover:

    //tempDateViewController.contentSizeForViewInPopover=CGSizeMake(320, 300);
    currentPopover.popoverContentSize = CGSizeMake(320, 300);
    

    Finally, a separate issue but, the minimum height for a datepicker should be 216, not 200:

    CGRect pickerFrame = CGRectMake(0,0,300,216);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here's the situation: I have a where in every cell all the area has
I have a puzzling situation I need some help with here please. I am
Here is my situation: I have one table that contains a list of drugs
Here's the situation I have a webpage which has one drop down called prefer.
Please help me figure this out. I apologize if this is a duplicate question,
This should be relatively simple, here is my situation; I have copied the trunk
I have a strange situation here. In my android app, I have a layout
I have a simple situation here. lets face html code first => <form name=geoKey
I have a unique situation over here. I have a button on a form
I have a really tough situation in here. There is an array of these

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.