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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:20:54+00:00 2026-06-05T13:20:54+00:00

Can someone help me with this scenario? *There is a button, which when tapped,

  • 0

----window1-----
----window2-----
Can someone help me with this scenario?

*There is a button, which when tapped, slides opens up a UIView, with the tapped button still to its left.

*This button when tapped again, makes the UIView slide back.

  • 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-05T13:21:01+00:00Added an answer on June 5, 2026 at 1:21 pm

    What you describe is easy. Let’s call the view that slides in from the right a drawer (“drawerView”). Set up the drawer view as a child view of your view controller’s main view.

    Make that “drawer” view a container view. Put everything you want inside it. (Your text view, buttons, etc.) Also put your button inside this view. Connect that button to an action “slideDrawer” in your view controller.

    Then make sure “clips subviews” is false, and move the button off the left edge of the drawer view with the left arrow key. In IB it will disappear, but don’t worry. IB doesn’t honor the “clips subviews” flag like your running program will.

    Create an outlet to your drawerView and link it up to your code.

    Once you have your drawer view looking exactly how you want it, note it’s x coordinate in the “size inspector”. Let’s call that value kVisibleX. Then drag that view to the right until it’s just off-screen. The button won’t be visible in IB, but will be visible just at the edge of the window at run-time. (like you show in your first image)

    Note the x coordinate of the drawer view when it’s offscreen. Let’s call that value kOffscreenX.

    Add a boolean instance variable “drawerIsShowing” to your view controller.

    Now write an IBAction method slideDrawer:

    - (IBAction) slideDrawer: (id) sender;
    

    In that method, check drawerIsShowing to see if the drawer is currently visible. If it is, slide it off-screen. If it’s not, slide it on-screen.

    - (IBAction) slideDrawer: (id) sender;
    {
      CGFloat newX;
      if (drawerIsShowing)
        newX = kOffscreenX;
      else
        newX = kVisibleX;
      [UIView animateWithDuration: .25
      animations: 
      ^{
        CGRect drawerFrame = drawerView.frame;
        drawerFrame.origin.x = newX;
        drawerView.frame = drawerFrame;
      }
    drawerIsShowing = !drawerIsShowing;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can someone help me with this? I have an AlertDialog box and its working
Can someone help me out with this one. I have a page, in which
Can someone please help me in this minute error. I wrote this, (which is
can someone help with this? I need the following function to do this... $x
Can someone help me with this strange issue, I want to play an audio
Can someone help me with this: This is a program to find all the
Can someone help me on this. I'm made an image uploader and i want
Im a beginner to css, please can someone help me get this element to
Can someone help me with converting this query to a Linq to entities query
I'm hoping someone can help with this, as it's driving me absolutely nuts. I

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.