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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:15:56+00:00 2026-05-12T20:15:56+00:00

I am pretty new to this iPhone dev thing but so far I have

  • 0

I am pretty new to this iPhone dev thing but so far I have built a pretty good app but I have stumbled into this problem that for the life of me I cannot seem to solve.

Basically the app is a chat application for social site. Everything is working 100% except the input box which currently is a UITextbox. This works fine however I would like the box to grow and be a multiline UITextbox with scroll. I replaced the UITextbox with a UITextview and all is good. I have the UITextview expanding as the user enters text however I have one slight problem that is driving me nuts.

When the UITextview gets focus it shifts the cursor and any text in there up just out of view. The UITextview I have set to display 2 lines by default and then as the height of the text goes beyond those two lines I would like the box to grown (which it does) and the text to remain scrolled up so you can see what you are typing. If you look at the SMS app on the iPhone this is exactly how I would like it work.

Any words of wisdom would be greatly appreciated.

  • 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-12T20:15:56+00:00Added an answer on May 12, 2026 at 8:15 pm

    I think Blaenk answered perfectly (that was going to be my answer). But just in case you don’t want to include Three20 in your project (it’s kinda big), below is the relevant code from TTTextEditor. You should be able to call this from wherever you are expanding the text view.

    - (void)scrollContainerToCursor:(UIScrollView*)scrollView {
      if (_textView.hasText) {
        if (scrollView.contentSize.height > scrollView.height) {
          NSRange range = _textView.selectedRange;
          if (range.location == _textView.text.length) {
            [scrollView scrollRectToVisible:CGRectMake(0,scrollView.contentSize.height-1,1,1)
              animated:NO];
          }
        } else {
          [scrollView scrollRectToVisible:CGRectMake(0,0,1,1) animated:NO];
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pretty new at this iphone dev stuff and i'm working on some existing
I'm pretty new to Objective C and iPhone development and have hit a problem
Ok. So I am pretty new a this. I have a datatable that I
I'm pretty new to iPhone development. I am building an app which has multiple
I'm pretty new to iPhone development - so apologies if this is a dumb
still pretty new to android I have to clone an iphone application. Im having
So, pretty new to iPhone dev and learning all the time. I know what
I'm pretty new to iPhone development. I have my root view and it is
I have a design question/technical question about my iPhone app. I have a pretty
I'm pretty new at this. Tried to make sense of the manual page for

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.