ios - UILabel incorrectly sized in UITableViewCell (Animation after assigning text) -


the text in uilabel flickering after being displayed, first appearing ellipsis on single line, occupying 2 lines fits in. notice cell height doesn't change.

uilabel wrap

here problem:
label "Друзъя, примите участие и наполните Коробку!" (friends, take part , fill boxes!) first appears truncated , misaligned "Друзъя, примите участи..." during view transition.

animation

this happens on iphone 4s ios 8.1. manipulation label (except text assigning) happens in storyboard.

what causing flickering?

assuming changing test in cellforrowatindexpath, , further assuming not happen strings, length, ios bug.

see lengthy discussion on this stack overflow uitableviewcell post, , possible workaround:

override func viewdidload() {     super.viewdidload()      tableview.setneedslayout()     tableview.layoutifneeded()     tableview.reloaddata() } 

notes

1. have noticed using small value estimatedrowheight such 20, not tall smallest cell, in combination doubled reloaddata() beneficial.

2. need invoke reloaddata() prior setneedslayout() when changing cell width, such toggling tableview.editing

3. robust alternative tinkering label use non editable, non selectable, none capitalization, noscrolling enabled, no show horizontal & vertical indicator, no bounce uitextview.


exercise bug, , try out various workarounds:

► find solution on github , additional details on swift recipes.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -