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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:11:43+00:00 2026-05-28T08:11:43+00:00

I have a small form which I built mostly in interface builder: When the

  • 0

I have a small form which I built mostly in interface builder:

enter image description here

When the user touches inside one of the textfields, I make the top part of the screen scrollable (note that it does not require any scrolling when the keyboard is not present, and that neither field is hidden behind the keyboard).

enter image description here

I achieve this with very little code. My form controls are all inside a UIScrollView, which is disabled and sized 0x0 (by default) on load. When I detect the keyboard’s presence I enable it and resize it to the views’s width and the view’s height + the keyboard size. I then disable and resize the scrollview when the keyboard is removed (I set it back to 0x0).

This works almost perfectly. With one exception (so far):

The scrollable area (or rather, the view inside it) is too tall. Because the form without the keyboard does not take up the whole screen, I find that I can scroll to the bottom of my view (one full screen) + keyboard height, when what I really want is to scroll to the view’s contents + keyboard height.

I thought I could simply make the view shorter so that it is just the right size for the contents, but interface builder (xcode 4.2) seems to force it to take up the whole screen. Attempting to do it in code also doesn’t work, because apparently self.view.frame.size is not assignable. How can I achieve what I’m looking for? Specifically, when the keyboard is present, I want the scrollable area in the top half of the screen to be sized such that there isn’t so much ‘slack’ at the bottom:

enter image description here

  • 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-28T08:11:44+00:00Added an answer on May 28, 2026 at 8:11 am

    First, self.view.frame is a struct with two fields that are structs itself – size and origin. If you want to change either size or origin, you have change the whole frame

    self.view.frame = CGRectMake(self.view.frame.origin.x,self.view.frame.origin.y, 
        self.view.frame.size.width, <your desired height>);
    

    Second, what base do use to create your form? This looks like just a UITableVIew. If so, consider changing type of your UIViewController to UITableViewController, since it handles keyboard automatically.

    If neither is an option for you, provide the code you use when handling keyboard appearance, so that we could think of more concrete answer.

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

Sidebar

Related Questions

I have a small form in which the user uploads a file. What I
In my c# application i have this small form which is used to set
I want to globalize my application. I have created a small form which asks
I'm developing a small POS for a university project. I have a form which
I have a small form inside a table. POSTing that form creates a new
I have a very small form where a user can enter their zip code
I have defined a small DSL that is mostly written in the form of
Post-release, I have made one small change to one form in our development site
i have a small form with four EditText fields in which second EditText is
I have a small form, which comes up when I press a button in

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.