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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:40:16+00:00 2026-05-28T06:40:16+00:00

I am creating an app, in which I have two small imageview (using have

  • 0

I am creating an app, in which I have two small imageview (using have of screen each)
One of this views has a uiimageview as a subview, I need to change this view to be a subview of the otherImageView, after I drag it to it, I’m using removeFromSuperview: & addSubview: methods, but the problem is that the reference of the position is the first imageView, that is why I’m having problems positioning the imageview in the new superview…
Is there a better way to do this?
I hope this is understandable, if I need to put some code, let me know.
Thank you so much

Edit: I’m adding some code that I’m using

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

startPoint_ = [[touches anyObject] locationInView:self];
CGPoint newPoint = [[touches anyObject] locationInView:self.superview];
CGRect frm = [self frame];
newPoint.x -= startPoint_.x;
newPoint.y -= startPoint_.y;

frm.origin = newPoint;
currentPoint_.x = frm.origin.x;
currentPoint_.y = frm.origin.y;

}

In the second line of this code I’m locating the view en self.superview (the origin superview). In order to manage better the position, could be a good idea to change this location to self.superview.superview (that is containing both views). Thank you!

  • 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-28T06:40:17+00:00Added an answer on May 28, 2026 at 6:40 am

    I am not sure I fully understand the details of your question; anyway if I correctly interpret the sentence:

    the problem is that the reference of the position is the first imageView, that is why i’m having problems positioning the imageview in the new superview

    I think you should set the frame property of the UIImageView you move so that it appears in the proper location in the destination superview.

    Apart from that, removing and then adding as a subview seems the correct approach to me. If this reply does not help, you could try and post some code and possibly some snapshots to make your point more evident.

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

Sidebar

Related Questions

I am creating a java app. I have one class q2a2 which is a
I am creating an app which will have a question in a UILabel and
I have a JavaScript widget which communicates with my Rails app by creating tags
I am creating an iPhone app which I would like to have a similar
I have two related models (one to many) in my django app and When
I have a uitableview 'A' which has cells, on clicking one of the cell,
I am creating a calendar based app. I have two dates say present date,
I have a NavigationBar app with two views: a parent and a sub view.
I have two svn repositories, one each for the iOS and Android versions of
Our app would be creating dynamics forms for each users. We are considering two

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.