Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
In Android
Why did folks at Android defined this relationship as | ||||
I think you're getting too hung up on the wording. A "ViewGroup" has every bit as much reason to inherit from a "View" as a "TextView", and "ImageView" or ... more to the point ... a "ScrollView" or a "SurfaceView" (the latter two both "contain things"). Perhaps "View" wasn't necessarily the best choice of terms ... but the class heirarchy makes complete sense. Regardless of what it's subclasses are named :) IMHO ... | |||
Viewgroup inherits properties of views and does more with other views and viewgroup | |||
I think this is a great example of the Composite design pattern: http://en.wikipedia.org/wiki/Composite_pattern Even though the naming might not be the best... | |||
default
.
stackoverflow.comm
No comments:
Post a Comment