Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Jiayi Liu
12,199 PointsHow to setFrame the UILabel?
••• There is one UILabel for every custom cell in my table, and I wanted to configure the dimension for every label (a progress bar like rectangle label),
using [_progress_bar setFrame: _current_progress_rect],
the _current_progress_rect was correctly set before;
Actually I have NSLogged the frame of each label after configured , which indicates that the frame was all correctly set behind the scene, but nothing looks changed in my table, all labels still in their initial look;
••• Another curious thing is, whenever I re-arrange the cell, the progress bar's frame would be momentarily reset to wanted size, when cell re-arrange is Done, it backs to all the same frame again.
••• I have proved that [_progress_bar setBackgraoundColor:[some color]] and and all the applicable setters work in the same block, I assume the [setFrame] should do as well, but how come it doesn't display properly?
Any idea?