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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:46:32+00:00 2026-06-18T09:46:32+00:00

My app is showing the following: ‘Sample 1’ is just a view to display

  • 0

My app is showing the following:

Sample 1

‘Sample 1’ is just a view to display content. After I click up button, ‘Sample 1’ will scroll up and a new view ‘Sample 2’ will be showed from bottom, the final result is :

Sample 2

I think I should append the sample 2 view at the end of up button, and just adjust the frame of sample 1 and up button to show sample 2.

But I don’t know the details how to implement it. Is there a easy way to implement this?

  • 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-18T09:46:33+00:00Added an answer on June 18, 2026 at 9:46 am

    Just place your button and the 2 sample view’s in the UIScrollview and set the contentsize of the scrollview to the total height of the button and the 2 sample view’s.

    Next, you could disable the scrolling on the UIScrollView and connect the button to a method scrolling the UIScrollView up.

    Assuming you got your UIScrollView and the ‘sample’ view’s as properties in your custom UIViewController class you could do something like this:

    - (void)viewDidLoad
    {
        [super viewDidLoad];
    
        //disable scrolling
        self.scrollView.scrollEnabled = NO;
    }
    
    //connect this action to you button
    - (IBAction)buttonPressed:(id)sender{
    
        //if current position is top scroll down, otherwise scroll up.
        if(self.scrollView.contentOffset.y < 1){
            [self.scrollView setContentOffset:CGPointMake(0, self.sample1.frame.size.height) animated:YES];
        }else{
            [self.scrollView setContentOffset:CGPointMake(0, 0) animated:YES];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After following code and showing no errors when I use my button to access
I'm on an AR app for iOS for showing annotations on a camera view
What is the best way of showing your ExtJs app after a page refresh?
I am working for mobile app. I am showing popup with content, If content
in my app i am trying to download some video in button click. i
I am using the following code to display splash screen, but it is showing
I have the following models in my app (only showing the related scopes): class
i get the following when i click update after unchecking the full time box.
I have a Rails app getting the following error: Less::ParseError in Home#index Showing /Users/burtondav/sites/requestsys/app/views/layouts/application.html.erb
Getting the following error when implementing this calendar gem. NoMethodError in Users#show Showing /Users/nelsonkeating/Desktop/ReminDeal/app/views/users/show.html.erb

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.