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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:07:18+00:00 2026-06-15T17:07:18+00:00

Background: I have a Master-Detail view split view controller. In detail table view, I

  • 0

Background:

I have a Master-Detail view split view controller. In detail table view, I have a static table view with a cell containing only one UITextView to show the comment of a customer.

When I tap customer name in the Master view, it reads the comment information and set it in the text in UITextView in detail view’s viewWillAppear. At the same time, the UITextView resize with following code:

CGRect frame;
frame = self.detailCustomerCommentUITextView.frame;
frame.size.height = [self.detailCustomerCommentUITextView contentSize].height;

self.detailCustomerCommentUITextView.frame = frame;
[self.tableView reloadData];

The height of this cell is changed as well:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
CGFloat height = 30.0;

if (indexPath.section==3&&indexPath.row==1)
{
    height = MAX(self.detailCustomerCommentUITextView.frame.size.height, 30.0);

}else if (indexPath.section == 0 && indexPath.row == 0)
{
    height = 55.0;
}else if (indexPath.section == 1 && indexPath.row == 0)
{
    height = 47.0;
}

    return height;
}

Steps to reproduce the issue:

The first time I tap a customer (Customer Short), which has a short comment text. The resized frame is:
(CGRect) frame = origin=(x=67, y=-6) size=(width=568, height=32)

I got this value in breakpoint after:
self.detailCustomerCommentUITextView.frame = frame;

Then in heightForRowAtIndexPath, I got the same height:

(CGFloat) height = 32

This looks good, but in the app I saw no comment in UITextView!

I am pretty sure this text view’s text is not empty as I checked this in debug mode already.

Then I tap the same customer again, in Break point after:

frame = self.detailCustomerCommentUITextView.frame;

I saw
(CGRect) frame = origin=(x=67, y=-6) size=(width=568, height=10)

This means after the last frame resizing to height “32”, the UITextView is resized to height “10”.

Then the code runs through

frame.size.height = [self.detailCustomerCommentUITextView contentSize].height;

self.detailCustomerCommentUITextView.frame = frame;

I saw height is set to 32 again. But this time everything is perfect. I saw the comment text and the UITextView is resized:

Then I repeated the above steps, and see everything is fine and the UITextView is not resized any more.

Question Summary:

In my first tapping a customer Short, why the UITextView is resized to height 10 after it is successfully resized to height 32?

I used single step Debug but cannot find any other code that changes the frame.

Highly appreciate your kind help.

  • 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-06-15T17:07:19+00:00Added an answer on June 15, 2026 at 5:07 pm

    Issue resolved. I found although the UITextView is resized, when it calls heightForRowAtIndexPath, the UITextView’s frame is overlapped by the new height of cell.

    In storyboard, UITextView -> Size Inspector -> View -> Autosizing, I remove all inside arrow, leaving only outside I(Sorry I cannot tell which is Struts and which is Springs). By this way, the UITextView will be auto resize to fit the new height of cell.

    Hope this helps to anyone needs.

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

Sidebar

Related Questions

Quick background for those interested, I have a master detail table(options date), about 20
BACKGROUND: I have Master and Detail tables, M and D; M contains orders and
Background: I have an MVC layout (master) view which uses @Html.RenderAction to display a
I have a master page with one div Header. #header { background-image: url(images/ST_ERP_2.jpg); background-repeat:
Background: I have two tables master and detail . each row in detail contains
Background I have a dimension table that has a single record for each day.
The background to this is that we have a ASP.NET master page that reads
I have an iPad SplitViewController application with the following features: master (left hand) view
In a split-view-based iPad app I'm using a custom background image in my navigation
First, some background: I am trying to implement a master-detail interface in Cocoa (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.