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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:46:32+00:00 2026-05-22T18:46:32+00:00

I have a full-screen UITextView that gets smaller whenever the keyboard appears, so that

  • 0

I have a full-screen UITextView that gets smaller whenever the keyboard appears, so that the keyboard doesn’t cover any of the text. As part of this, I also change the textView’s bottom contentInset, so the space below the text is smaller when the keyboard is present, and larger when there is no keyboard.

The problem is, whenever the user taps the textView near the bottom to start editing, the bottom contentInset spontaneously resets itself to 32. I know from this answer that it is possible to subclass the UITextView and override the contentInset method, like this:

@interface BCZeroEdgeTextView : UITextView
@end

@implementation BCZeroEdgeTextView

- (UIEdgeInsets) contentInset 
  { 
  return UIEdgeInsetsZero; 
  }

@end

But this doesn’t stop the bottom inset resetting itself – it just changes the figure it resets itself to. How can I make my UITextView just keep to the contentInset value that I have set?

  • 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-22T18:46:33+00:00Added an answer on May 22, 2026 at 6:46 pm

    To make it keep the value you set, you could go the subclass route but return the value of your own property rather than a constant, something like this:

    @interface BCCustomEdgeTextView : UITextView
    @property (nonatomic, assign) UIEdgeInsets myContentInset;
    @end
    
    @implementation BCCustomEdgeTextView
    
    @synthesize myContentInset;
    
    - (UIEdgeInsets) contentInset { 
        return self.myContentInset; 
    }
    
    @end
    

    But do note that the reason UITextView resets its bottom contentInset to 32 is that a more standard inset will cut off the autocompletion popups and such.

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

Sidebar

Related Questions

I have several aspx pages that can be opened either normally (full screen in
Does Microsoft Access have Full Text Search? I know that MySQL and SQL Server
I have a ViewController that manages a view full of controls, including UITextView s,
I have a full-screen TextView holding a long Spanned that requires scrolling. The TextView's
I have a full-screen UIButton to capture all touch events, so that the scrollView
I have a paging UIScrollView that pages through multiple full screen images. I am
I have a full screen UIScrollView that has several possible layout configurations. It is
We have an online movie that displays full-screen. Instead of the now-standard flash-based fullscreen,
What I'm doing is I have a full-screen form, with no title bar, and
I'd like my application to have a full-screen mode. What is the easiest way

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.