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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:13:17+00:00 2026-06-09T10:13:17+00:00

I have opened a pop up window on button click. I want to set

  • 0

I have opened a pop up window on button click.

I want to set x and y position of that view. I have tried a lot but can’t set it properly.

This is my code:

-(IBAction)product2_click_h2
{
    //build our custom popover view
    UIViewController* popoverContent2 = [[UIViewController alloc]
                                         init];

    UIView* popoverView2 = [[UIView alloc]initWithFrame:CGRectMake(100,100,200,200)];

    popoverView2.backgroundColor = [UIColor greenColor];

    UITextView *prod2_info = [[UITextView alloc]initWithFrame:CGRectMake(5,5,390,290)];
    [prod2_info setFont:[UIFont fontWithName:@"Arial" size:15]];
    [popoverView2 addSubview:prod2_info];
    [prod2_info setEditable:NO];
    prod2_info.text = @"\n"
    "                    Higher Mileage Motor Oil :\n "
    "                --------------------------------------\n\n"
    "  -->  MaxLife NextGen Higher Mileage Motor Oil  \n\n" 
    "- Special seal conditioners rejuvenate seals\n"
    "   within the engine block to help \n"
    "   prevent oil leaks that lead to sludge and deposits.\n"
    "- Anti-oxidant additives reduce oil viscosity breakdown\n"
    "  to help prevent engine clogging sludge and deposit formation. \n"
    "- Detergents chemically bond with and remove existing\n"
    "  sludge and deposits\n"
    "- Additional friction-reducing additives help reduce abrasion within engine\n"
    "- Anti-wear agents help prevent engine damage \n"
    "- Available in the following viscosity grades \n"
    "    - 5W-30     \n "
    "   - 10W-30    \n ";
    prod2_info.scrollEnabled =YES;
    popoverContent2.view = popoverView2;
    popoverContent2.contentSizeForViewInPopover = CGSizeMake(400,300);

    //create a popover controller
    self.popovercontroller_2 = [[UIPopoverController alloc]
                                initWithContentViewController:popoverContent2];

    //present the popover view non-modal with a
    //refrence to the button pressed within the current view
    [self.popovercontroller_2 presentPopoverFromRect:product2.frame
                                              inView:self.view
                            permittedArrowDirections:UIPopoverArrowDirectionAny
                                            animated:YES];

}

Here’s what it looks like right now:

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-09T10:13:19+00:00Added an answer on June 9, 2026 at 10:13 am

    instead of this:

    [self.popovercontroller_2 presentPopoverFromRect:product2.frame
                                              inView:self.view
                            permittedArrowDirections:UIPopoverArrowDirectionAny
                                            animated:YES];
    

    just make change like this:

    [self.popovercontroller_2 presentPopoverFromRect:product2.frame
                                              inView:**button.bounds**
                            permittedArrowDirections:UIPopoverArrowDirectionAny
                                            animated:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have opened www.makemytrip.com website and try to click on Round Trip radio button
I have a pop up window which user can select files and then it
I have an image button on a pop up page which is opened by
I have opened a JSP web project in Eclipse but not sure how to
I have opened a new window with JavaScript: var newwin = window.open('','preview','width=600,height=500'); Now I
i have tried this: <?php $fileip = fopen(test.txt,r); ?> this should have opened the
On a typical OS how many files can i have opened at once using
I have a pop up window which lists images using a form and radio
I have a document that I have opened in notepad++ that has the following
We have a website that needs to perform certain actions when a pop-up is

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.