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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:53:56+00:00 2026-05-24T18:53:56+00:00

I have a scroll view with 2 different subviews for two different orientation. In

  • 0

I have a scroll view with 2 different subviews for two different orientation.
In portait mode, it shows a table view and in portait it shows the UIImageView.
I want to know the ideal way to handle the orientation.
I am having glitches with my current way of handling
1.Load a view,and add scrollview as a subview to the root view.
2.Change orientation,
3.Change the frame and contents of the scrollview.
4.Add this modified scrollview as subview again.

But, every time I change orientation,the new view gets added on top of the previous one.

  • 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-24T18:53:56+00:00Added an answer on May 24, 2026 at 6:53 pm

    If you want to have two different views for different orientations, you need to switch them while orientation is changing.

    When you go from portrait to landscape, you have to remove UIImageView and add scrollview (and vice versa)

    [myImageView removeFromSuperview];
    [self.view addSubview:scrollView];
    

    You can also check if view doesn’t have a superview to be sure that you have to add it:

    if(scrollView.superview == nil)
        [self.view addSubview:scrollView];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a grouped table view that utilizes two different custom table cells. When
I have a table view controller which doesn't let me manually scroll to the
I have a scroll view, which contains about 40-50 objects of different types. The
I have an scroll view with some sophisticated animations happening during scrolling. Although after
I have a scroll view with transparent background that covers most of the screen.
Suppose I have a scroll view in a view & a scroll view's size
I have a GTK# Text View with word wrap and scroll bars turned on.
I have UIScrollView in my view. Problem is that if I slightly scroll it
I have an app that shows a series of UIImageView s on a ScrollView
I have two datagrids side by side bound to different data tables and each

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.