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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:44:49+00:00 2026-06-11T02:44:49+00:00

I am creating a app and need to get the button’s frame respect to

  • 0

I am creating a app and need to get the button’s frame respect to the view.

I have a mapview with annotation. While selecting the annotation it shows a callout bubble. That has a button as right accessary view. I have a selector that gets invoked when I tap on that button.

Now I want to get the frame of the button with respect to the view’s bound. I want to know where the button is located in the view?

For that I tried:

[self.view convertRect:btn.frame fromView:self.view];

and

[self.view convertRect:btn.frame toView:self.view];

I am not getting correct result.

  • 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-11T02:44:51+00:00Added an answer on June 11, 2026 at 2:44 am

    The btn.frame is relative to its (the button’s) super view so passing self.view for fromView won’t give the expected result because self.view is not the button’s super view (in the case of an annotation callout button). So that code should be:

    CGRect rect = [self.view convertRect:btn.frame fromView:btn.superview];
    

    Similarly in the toView call, the method needs to be called on the button’s super view since btn.frame is relative to it (not self.view):

    CGRect rect = [btn.superview convertRect:btn.frame toView:self.view];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are creating a web app where we need to have concurrency for a
I'm creating an iphone app using Facebook apis. I need to get the user's
I am creating a basic app with health tips. I need screens to get
I am just learning about app.config in respect of creating custom sections. I have
I'm currently creating an iPhone app and we need some testing with about 20~30
I need some references for creating a Rails app where each client/company has his
Hi i'm creating an app which have shopping cart and payment done via paypal
I am creating an App with following design: I have a UITableView with custom
I have been creating a drawing app as a test for WPF, and have
I have created a normal app - initially without cocos2d. Now I need cocos2d

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.