According to the documentation for UILabel the default contentMode is 'redraw'. 
I've been chasing an issue in my code where I set the center and bounds of one 
in layoutSubviews of the parent to keep it centered but it wasn't being, it was 
moving all over the place. I randomly found that calling setNeedsDisplay on the 
UILabel fixed the issue. Digging deeper I found that using setFrame: instead of 
setCenter: and setBounds: worked without the setNeedsDisplay. I don't really 
like using setFrame: if I can avoid it because it only works with unit matrix 
transforms. 

Checking the documentation the default for a UILabel should be redraw, but I 
found that any UILabel dragged into IB actually has contentMode 'left' set, 
which is I think what stopped the setBounds doing the right thing and 
redrawing. 

1) does that sound like an IB bug which needs reporting? 
2) why does setFrame cause a redraw when setBounds/setCenter doesn't if the 
contentMode is set to 'left' either they all should, or they all shouldn't.  


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to