-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Inital badge project created with example #29
Conversation
Shouldn't -setText: invoke -setNeedsLayout rather than -setNeedsDisplay? |
No, as it's not doing a sub layout as everything is manually drawn onto the view. -setNeedsDisplay will invoke -drawRect which is what is required. There is a previous comment on this. Sent from my iPhone On 14 Aug 2011, at 16:39, bmeurerreply@reply.github.com wrote:
|
-setText: is different, because the size depends on the actual text in your -sizeThatFits: implementation, so relayouting makes sense when text changes. |
Even the text is drawn within -drawRect, therefore I want -drawRect to be called which -setNeedsDisplay does. Only if text was being added via UILabel in overriding the -layout method would -setNeedsLayout be required. That's my understanding of it anyway...will happily be corrected :) Sent from my iPhone On 14 Aug 2011, at 20:17, bmeurerreply@reply.github.com wrote:
|
I'm not an expert in the UIView programming stuff, but my understanding is that -setNeedsLayout triggers layout, which in turn triggers redisplay, and whenever something is about to change the (preferred) size of an UIView it should invoke -setNeedsLayout. But as said, that's just how I read the documentation. |
Forget about that. I stand corrected. -setNeedsLayout is only for subviews of the receiver. |
This should be in a decent state now; with documentation, and rebased with current master (0.6.1). Let me know if there are any changes required? |
Will do! I'm going to play with this a bit today I think after I write unit tests for the Nimbus Models. |
Just wondering whether this is pretty much completed now? |
This should be ready :) |
This is only an early version of a badge view using QuartzCore.
Does not have a badge "gloss" yet and also not yet documented.
Challenges: