I am working on a custom ViewGroup that extends LinearLayout but only accepts children of a particular subclass. At the first possible moment I have the opportunity, I want to set some properties on the children (things like their index etc). In Flex there is a method called createChildren() where all children are created and then an event called creationComplete is fired (the children are created but not measured/la开发者_如何学Goid out yet). Whats the equivalent in Android?
Is there a reason for adding properties to the view before it is drawn? If not than you can use myViewGroup.setTag(myObjectTag)
to attach an object to the view (perhaps Integer since you want to use it to index) and myViewGroup.getTag()
to return the view's object "tag".
精彩评论