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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:09:25+00:00 2026-06-16T21:09:25+00:00

I have a UIViewController with a custom UITextView in it (CodeTextView) and left of

  • 0

I have a UIViewController with a custom UITextView in it (CodeTextView) and left of this text view I have a custom UITableView (LinesTableView). LinesTableView contains the line numbers aligned to the CodeTextView.

When I start editing the CodeTextView and when the keyboard appears, I edit the size of both views:

- (void)keyboardAppears:(NSNotification *)notification
{
    [_codeTextView setFrame:CGRectMake(30, 0, 290, self.view.frame.size.height - 216.0f)];
    [_linesTableView setFrame:CGRectMake(0, 0, 30, self.view.frame.size.height - 216.0f)];
}

When editing the CodeTextView and when I press a button, I update the LinesTableView:

- (void)updateLines
{
    NSString *plainText = self.text;
    NSArray *components = [plainText componentsSeparatedByString:@"\n"];
    int lines = components.count;
    if([[components lastObject] isEqualToString:@""]) lines--;
    _linesTableView.lines = lines;
    [_linesTableView reloadData];
}

However, when the keyboard is shown and when I press enter, the CodeTextView gets resized to it’s original height! When I comment out the [_linesTableView reloadData], everything is working fine. So somehow LinesTableView and CodeTextView gets their original heights back when I reload the LinesTableView.

I don’t know how to fix this. I think it’s not hard but I can’t come up with a way to do this. Could anyone please help me with this?

Thanks in advance! 🙂

  • 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-16T21:09:26+00:00Added an answer on June 16, 2026 at 9:09 pm

    Quick and dirty way would be to put both things in a UIView that wraps them, so you can resize that UIView and make it clip it’s contents, intead of resizing the actual table. That way, when the data is reloaded, even if the view scales up again it’ll remain clipped. In my head, it would even look better if you use a UIScrollView and put the 2 non-scrolling components in it. That way the place occupied by the keyboard doesn’t ruin the experience that much.

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

Sidebar

Related Questions

I have a UIViewController whose view has a custom subview. This custom subview needs
i have a custom UIView which is presented from a UIViewController . This view
I have a custom view MyView : UIViewController <UITableViewDelegate, UITableViewDataSource> with a UITableView within
I have a custom UIViewController subclass that handles all the view initialization by itself
I have a few custom UITableViewCells - http://img11.imageshack.us/i/customfacilitiescell.png/ which are added to this UIViewController
I have a problem with data in UITableView. I have UIViewController, that contains UITableView
I have a custom UIViewController and a corresponding view in a nib file. The
I have a UITableView , which I am controlling from a custom UIViewController .
I have a custom UIViewController inited from a nib file with the following view
I have custom UIViewController which looks like this. @implementation UIViewControllerCustom - (id)init { self

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.