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 some text in a UITextView, that I would like to have show
I have n number of UITextview and that are added to UIScrollview.and uiscrollview is
I have a UITextView inside a UITableViewCell . It's working as expected except that
I have a UITextView that is supposed to have one line of text. The
I have a UITextView subclass that has an NSIndexPath property that is inside a
Setup: I have a UITextView inside a UITableViewCell 's contentView . I want it
I have a UITextView that has a lot of content. I have a button
I have a large amount of text in a UITextView. I want to let
I have a UITextView on a View that becomes the first responder. When I
I have a UITextView that is editable on a parent view along with a

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.