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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:08:20+00:00 2026-06-07T17:08:20+00:00

I have scrollView in which there are 12 buttons. On window only four buttons

  • 0

I have scrollView in which there are 12 buttons. On window only four buttons are visible at a time. For animation purpose I need button’s position regarding to the window.

I had followed these methods but its not working for me:

[btn.superview convertPoint:btn.frame.origin toView:nil];

btnImgeView.frame= CGRectMake(btn.frame.origin.x + 10, 240, btn.frame.size.width, btn.frame.size.height);

btn.frame.origin.x is taking coordinate from scrollView’s origin not from the origin of the screen.

how can I get the button’s position regarding to the window?

  • 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-07T17:08:22+00:00Added an answer on June 7, 2026 at 5:08 pm

    From your description it sounds like what you really want to do is display an image view where an button appears, but its location is inside a scroll view.

    As suspected, calculating screen coordinates is not the correct approach here. Instead, you need to offset the button’s rect/origin with the scroll view’s displacement to determine the correct position.

    Use the scroll view’s -contentOffset property to get a CGPoint indicating the, well, offset of the content. Subtract that point from the button’s bounds origin (or just center if you would like something more convenient). That will give you the correct point at which to display your image (relative to the scroll view’s frame origin).

    If you aren’t displaying the image in the scroll view, you can transform the point to the superview’s coordinate system with -[UIView convertPoint:fromView:] or [UIView convertPoint:toView:].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scrollview in which i am creating buttons programmatically. On touch, button
I have Dockpanel on which there are two buttons (left and right sides) and
Is there any way I can get hold of which button I have pressed?
I have a UIView which contains lot of labels, buttons, textviews. But there is
I have a scrollview which has to display a view larger than the available
On Android 4, I have a simple ScrollView which presents a form to fill
I have a Nib with a scrollview which i use on my controller. I
I am have an issue with my scrollview which holds multiple views. I think
I am trying to create a scrollview which will have many views (uiimageviews, uitextfield,
I have an app which contains a scrollview with several tableviews. Each tableview 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.