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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:07:24+00:00 2026-05-21T16:07:24+00:00

In my app, I have a split screen in which the detail view is

  • 0

In my app, I have a split screen in which the detail view is a scrollview. I have 5 tables which are subviews of my scrollview in which 3 table views are side by side on top and 2 table views are side by side on bottom

I have already implemented a way in which when I click any of the rows of any of the table in the scrollview, that view disappears and another view zooms into its position.

I write the following code in the didSelectRowAtIndexPath in the middle table subview,

CGFloat xpos = self.view.frame.origin.x;
    CGFloat ypos = self.view.frame.origin.y;
    self.view.frame = CGRectMake(xpos+100,ypos+150,5,5);
    [UIView beginAnimations:@"Zoom" context:NULL];
    [UIView setAnimationDuration:2];
    self.view.frame = CGRectMake(xpos,ypos,220,310);
    [UIView commitAnimations];
    [self.view addSubview:popContents.view];

popContents is the view I need to zoom into to the view previously occupied by that particular table view and that happens correctly.

However the problem that I am facing is that since there is another table subview in the side, if I increase the frame size to say 250 or so, the part of the zoomed in view gets hidden by the tableview on the side ( as its as if a part of the zoomed in view goes under the tableview on the side).

Is there anyway to correct this so that my zoomed in view would not get hidden by the tableviews on its sides?

I hope I have explained my problem correctly…

UPDATE:

Here is the code I am using for adding the subviews for the scrollview

// Scroll view
scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 30, 1000, 740)];
scrollView.contentSize = CGSizeMake(1000, 700);
scrollView.delegate = self;
scrollView.scrollEnabled = YES;
scrollView.showsHorizontalScrollIndicator = YES;
scrollView.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
[self.view addSubview:scrollView];


aView = [[aViewController alloc] initWithNibName:@"aViewController" bundle:nil];
aView.view.frame = CGRectMake(10, 25, 220, 310);
[aView loadList:objPatients];
[scrollView addSubview:aView.view];

bView = [[bViewController alloc] initWithNibName:@"bViewController" bundle:nil];
bView.view.frame = CGRectMake(10, 350, 220, 310);
[bView loadList:objPatients];
[scrollView addSubview:bView.view];

cView = [[cViewController alloc] initWithNibName:@"cViewController" bundle:nil];
cView.view.frame = CGRectMake(240, 25, 220, 310);
[cView loadList:objPatients];
[scrollView addSubview:cView.view];

dView = [[dViewController alloc] initWithNibName:@"dViewController" bundle:nil];
enView.view.frame = CGRectMake(240, 350, 220, 310);
[enView loadList:objPatients];
[scrollView addSubview:dView.view];

eView = [[eViewController alloc] initWithNibName:@"eViewController" bundle:nil];
eView.view.frame = CGRectMake(470, 25, 220, 310);
[eView loadList:objPatients];
[scrollView addSubview:eView.view];

say for example, I add the code for didSelectRowAtIndexPath in cViewController subview…

  • 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-21T16:07:24+00:00Added an answer on May 21, 2026 at 4:07 pm

    This is a guess since I would need to know how your table views are added to the scroll view, but the middle table view was probably added before the one on the side. Views are “stacked” in the order they’re added with the last one on top. You’ll need to get the scroll view to move the middle view to the front with this method

    - (void)bringSubviewToFront:(UIView *)view
    

    The best way to do that would be to create a protocol for the table views and make the scroll view the delegate. The method would be something like this

    - (void) moveAViewToFront: (MyTableView *) aTableView
    {
        [self.view bringSubviewToFront: aTableView.view];
    }
    

    You would then call the delegate method before setting up the animation.

    Edited

    After a little more thought I realized that the subviews have a reference to their superview so this bit of code should provide an idea on how to solve the problem. I created a test app which has a view controller which adds two sub views. The view controller header file is MoveSubviewViewController.h

    #import <UIKit/UIKit.h>
    
    @interface MoveSubviewViewController : UIViewController
    {
    }
    
    @end
    

    and it’s implementation is

    #import "MoveSubviewViewController.h"
    #import "MoveableSubview.h"
    
    @implementation MoveSubviewViewController
    
        - (void)viewDidLoad
        {
            [super viewDidLoad];
    
            // Create two overlapping subviews. The blue subview will start at the top of
            //  the frame and extend down two thirds of the frame.
            CGRect superviewFrame = self.view.frame;
            CGRect view1Frame = CGRectMake( superviewFrame.origin.x, superviewFrame.origin.y,
                                           superviewFrame.size.width, superviewFrame.size.height * 2 / 3);
            MoveableSubview *view1 = [[MoveableSubview alloc] initWithFrame: view1Frame];
            view1.backgroundColor = [UIColor blueColor];
            [self.view addSubview: view1];
            [view1 release];
    
            // The green subview will start one third of the way down the frame and
            //  extend all the to the bottom.
            CGRect view2Frame = CGRectMake( superviewFrame.origin.x,
                                           superviewFrame.origin.y + superviewFrame.size.height / 3,
                                           superviewFrame.size.width, superviewFrame.size.height * 2 / 3);
            MoveableSubview *view2 = [[MoveableSubview alloc] initWithFrame: view2Frame];
            view2.backgroundColor = [UIColor greenColor];
            [self.view addSubview: view2];
            [view2 release];
        }
    
        @end
    

    The subview class is MoveableSubview with another simple header

    #import <UIKit/UIKit.h>
    
    @interface MoveableSubview : UIView
    {
    }
    @end
    

    and implementation

    #import "MoveableSubview.h"
    
    @implementation MoveableSubview
    
    - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
    {
        // Move this view to the front in the superview.
        [self.superview bringSubviewToFront: self];
    }
    
    @end
    

    The thing to do is to add the

    [self.superview bringSubviewToFront: self];
    

    line before setting up the animation.

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

Sidebar

Related Questions

I have been asked to write an app which screen scrapes info from an
I have a split view controller-based iPad app that uses a Web View to
I have a large Java app that is split up into multiple projects. Each
I have a windows forms app where I have split different functionality into several
I have an App which has a Tasks tab and a Projects tab. I
In my app have a window splitted by a QSplitter, and I need to
On my rails app I have a list of items (like a task list)
For my Django app I have Events, Ratings, and Users. Ratings are related to
In my app I have 2 divs, one with a long list of products
While developing my app I have come to realize that the majority of my

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.