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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:09:43+00:00 2026-05-27T01:09:43+00:00

I have an iphone app. The view is consists of two children: a tableview

  • 0

I have an iphone app. The view is consists of two children: a tableview 400 pixels tall and a uitextview at the bottom of the view that is about 80 pixels tall.

I am trying to move the textview and tableview upwards when the keyboard is visible. I resized the “main” view to make it smaller. Why don’t its children appear to resize as well?
Do I need to readjust the frame of the tableview, and readjust the frame of the textview as well? I’m just wondering what the expected behavior is. Do I need to use setNeedsLayout() or setNeedsDisplay?

I expected that by downsizing the “main” view, its children would be “shrunk” and constrained by their parent view as well. It looks like the textview remains at the bottom of the screen. The tableview appears to be correct (it shrunk), but the textview doesn’t look like it moves. Although in the new shrunken view there is now a white area where the textview should move to.

// Called when the UIKeyboardDidShowNotification is sent.

– (void)keyboardWasShown:(NSNotification*)aNotification {

NSLog(@"keyboard was shown");
NSDictionary* info = [aNotification userInfo];
CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
//CGRect keyboardFrame = [[info objectForKey:UIKeyboardFrameEndUserInfoKey]CGRectValue];
NSLog(@"kb size is:%f",kbSize.height);

//UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, kbSize.height, 0.0);

CGRect newFrame = self.view.frame;
//20 status bar height, 44 is nav bar height
newFrame.size.height = 480 -20 - 44 - kbSize.height;

self.view.frame = newFrame;
self.view.layer.borderWidth = 1.0f;
self.view.layer.borderColor = [[UIColor redColor] CGColor]; 

[self.view setNeedsLayout];
[self.view setNeedsDisplay];

}

  • 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-27T01:09:44+00:00Added an answer on May 27, 2026 at 1:09 am

    Try use UIScrollView.
    Put this controls inside scrollview and use property contentOffset to scroll up/down.
    This is very easy way.

    Good luck!

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

Sidebar

Related Questions

I have an iPhone app that shows a simple view (View 1) that has
I have an iPhone app, where I'm displaying a tableview, that's loaded from an
I have an iPhone app that starts in a table view and goes to
I have an iphone app that uses table view as the interface. Each time
I have an iPhone app that has several different view controllers. A login screen
I have an iphone app that has a root view with a button that
I have an iPhone app that displays a modal view controller. The modal view
I have an iPhone app that overlays an image over a view created by
I have an iPhone app with a main view that has a UILabel and
I have an iPhone app that hides the status bar. However, my main view

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.