Note that there are some explanatory texts on larger screens.

plurals
  1. POios create 'readmore'. Let superview be dependent of subview
    primarykey
    data
    text
    <p>gaaah designing in ios gives me headache!! So please, help me out and maby explain to me how one should think trying to come up with the solution.</p> <p>I have:</p> <p><img src="https://i.stack.imgur.com/yz0OB.png" alt="UITableView with its header"></p> <ul> <li>As you can see the UITextField has its frame being set in storyboard to be smaller than its actual content.</li> <li>Everything above the prototypecell is within a UIView that is set to be tableHeader programatically.</li> </ul> <p>I want to:</p> <p>Press the read more btn so that the UITextField get its actual size. No problem, I can do that with getting the contentSize programmatically. It works but it ofc overflows the tableHeader</p> <p>So I thought, good. Then all I have to do is set the tableHeader to be the size of the 'new' calculated height of UITextField + height of the 2 UIImageViews.</p> <p>But nope. it only resizes to the existing height set in storyboard insted. In other word, it does one or the other. And using autolayout it totally breaks but not giving me any errors about constraints.</p> <p>This seems so easy wich makes me feel so stupid haha</p> <p>this is what I have i code</p> <pre><code>- (IBAction)toggleReadMore:(id)sender{ _toggleReadMoreBtn.hidden = YES; CGRect textFrame = _cityDescription.frame; _cityDescription.frame = textFrame; CGRect tableHeaderViewFrame = CGRectMake(0, 0, self.tableView.tableHeaderView.frame.size.width, _cityDescription.contentSize.height + 218.0f ); //textFrame.size.height self.tableView.tableHeaderView.frame = tableHeaderViewFrame; textFrame.size.height = _cityDescription.contentSize.height; [self.tableView setTableHeaderView:self.viewForTableHeader]; </code></pre> <p>please, guide me how to think</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload