开发者

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()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜