iphone - question about UIView's sizeThatFits -


possible duplicate:
iphone — input parameter uiview's sizethatfits method

specifically, what's argument supposed be? documentation says it's receiver's current size, view can use self.bounds.size, doesn't make sense.

is supposed available space? in other words, parent asking child, "given there's available space of x x y points, how big want be?".

i believe doc wrong when says "the current size of receiver". use case there others: example if want view return best size given arbitrary size call method passing arbitrary size parameter.

is supposed available space? in other words, parent asking child, "given there's available space of x x y points, how big want be?".

yes, you've got idea don't restrict meaning of argument "available space". it's arbitrary size may or not correspond available space. depends on how using method. view supposed return considers best size (the size best fits subviews) if has fit size passed argument.

look here, should answer question: iphone -- input parameter uiview's sizethatfits method


Comments