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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:28:56+00:00 2026-05-24T07:28:56+00:00

I have a UITextView inside of a UIScrollView that is configured offscreen when the

  • 0

I have a UITextView inside of a UIScrollView that is configured offscreen when the code below runs in my ViewController's viewDidLoad. Unfortunately, if the “eventDetails” text is particularly long nothing is displayed inside the UITextView until I interact with it (e.g click inside and drag for example).

My question: How to have it so the text is displayed in the UITextView WITHOUT forcing the user to interact with the UITextView first?

Here is the code:

UITextView *txtDetails = [[UITextView alloc] initWithFrame:CGRectMake(-4, yOffset, page3ScrollView.frame.size.width, 0)];
[txtDetails setEditable:NO];
[txtDetails setScrollEnabled:NO];
[txtDetails setFont:[UIFont systemFontOfSize:12]];
[txtDetails resizeAndSetTextWithMaxSize:CGSizeMake(txtDetails.frame.size.width, 999999999) forText:eventDetails withAdditionalHeightOf:16.f];

[page3ScrollView addSubview:txtDetails];

CGRect frame = txtDetails.frame;
frame.size.height = [txtDetails contentSize].height;
txtDetails.frame = frame;

[page3ScrollView setContentSize:CGSizeMake(page3ScrollView.frame.size.width, txtDetails.frame.origin.y + txtDetails.frame.size.height)];

Thanks

  • 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-24T07:28:57+00:00Added an answer on May 24, 2026 at 7:28 am

    I was able to get this working by setting the UITextView’s text ONLY when needed (e.g. is about to come on screen). Below is the relevant code:

    - (void)scrollViewDidEndDecelerating:(UIScrollView *)sv 
    {
        if (sv == scrollView) [self updatePagedView];
    }
    
    - (void)updatePagedView
    {
        int currentPage = pageControl.currentPage;
    
        // *** loadDetailsPage3 is where I set the text ***
        if (currentPage == 2) {
            [self loadDetailsPage3];
        }
    }
    

    If anyone has a better solution or needs more explanation just hit me up in the comments.

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

Sidebar

Related Questions

I have a UIScrollView, inside which I have some UILabels and a UITextView. The
I have a UIScrollView that has a number of UILabels and UITextViews inside it.
I have a UITextView embedded inside a grouped table view cell that I can't
I have an application in which adds the text inside a UITextView into Core
I have a UIView that contains a UITextView . The UIView is initiated inside
I have a UITextView inside a UITableViewCell . It's working as expected except that
I have a UITextView subclass that has an NSIndexPath property that is inside a
I have UITextView subviews inside a UITableViewCell . When user taps on the cell
I have a UITextView inside a UITableViewCell in a table. editable for the UITextView
I have a UiTextView inside a custom UITableViewCell. The keyboard appears when i select

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.