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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:04:53+00:00 2026-05-31T14:04:53+00:00

I have a UITextView and it has a weird margin at the top, not

  • 0

I have a UITextView and it has a weird margin at the top, not sure what’s causing this. Here’s the picture, the background is orange:

enter image description here

Here’s my relevant code:

textViewTest = [[UITextView alloc] initWithFrame:CGRectMake(135, 0, 150, 68)];
[textViewTest setContentInset:UIEdgeInsetsZero];
[textViewTest setUserInteractionEnabled:NO];
[textViewTest setBackgroundColor:[UIColor orangeColor]];
[textViewTest setTextColor:[UIColor whiteColor]];
//[textViewTest setFont:[UIFont fontWithName:@"MuseoSans-500" size:12.0]];
[textViewTest setText:@"Spooky (rename)\nCreated: 4/10/11\nUpload Youtube\nDelete | Favorite"];

What I want is the text in UITextView (textViewTest) to not have any space from the top (margin). Currently, there’s like 8-10 px from the top of the orange, then the text starts.

  • 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-31T14:04:54+00:00Added an answer on May 31, 2026 at 2:04 pm

    If you only want to move the text, try

    [textViewTest setContentInset:UIEdgeInsetsMake(<#CGFloat top#>, <#CGFloat left#>, <#CGFloat bottom#>, <#CGFloat right#>)];
    

    Where a positive number moves the frame towards the middle, a negative moves it out from the middle.

    For example, [textViewTest setContentInset:UIEdgeInsetsMake(-5, 0, 5,0)], will move the text 5 pixels up!

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

Sidebar

Related Questions

I have a UITextView that has a lot of content. I have a button
I have a Flip View and on this flipped view I have a UItextView,
I have a ViewController that has a couple of IBOutlet properties defined for UITextView.
I have a UITextView that has a fixed width and height. I pre-populate the
I have a UITextView subclass that has an NSIndexPath property that is inside a
I have a very, very weird effect here using Monotouch 5.2.5 running my app
I have a UITextView which has a UIWebView just below it. The frame of
I have a UIScrollView which has a subview UITextView. When I added text to
I have a UITextView object. The text in UIView has a phone number, mail
I have a UITextView that has some text in it. The problem is that

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.