Accessing child elements, using parent defined in xml, android
<ViewFlipper开发者_如何学Python android:id=@+id/flipper >
<ListView android:id=@+id/xyz />
<ListView android:id=@+id/pqr />
<ListView android:id=@+id/abc />
</ViewFlipper>
flipper=(ViewFlipper)findViewById(R.id.flipper);
Can I access the id of child elements of flipper(xyz,pqr,abc) ? no. of child elements of flipper ?
Can I access the id of child elements of flipper(xyz,pqr,abc) ?
Yes, you can. For example as this:
flipper.getChildAt(index).getId()
no. of child elements of flipper ?
If you mean count of children then:
flipper.getChildCount()
精彩评论