我如何编程显示ViewFlipper的第二个孩子? [英] How can I programmatically display a ViewFlipper's second child?

查看:273
本文介绍了我如何编程显示ViewFlipper的第二个孩子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个孩子一个ViewFlipper。

我希望能够在最初显示这些孩子。因此,例如,也许我想ViewFlipper与第二个孩子,而不是最初一号装载。

编辑:
我知道我可以使用getChildAt(INT指数)方法。

当显示在ViewFlipper一个孩子,我怎么能得到孩子的指数?


解决方案

  

我希望能够在最初显示这些孩子。因此,例如,也许我想ViewFlipper
  与第二个孩子,而不是最初一号装载。


呼叫 setDisplayedChild()


  

当在ViewFlipper孩子所示,我怎么能得到孩子的指数?


呼叫 getDisplayedChild()

I have a ViewFlipper with 3 children.

I want to be able to display any of these children initially. So for example, maybe I want the ViewFlipper to load initially with the 2nd child and not the 1st.

EDIT: I know I can use the getChildAt(int index) method.

When a child in a ViewFlipper is shown, how can I get that child's index?

解决方案

I want to be able to display any of these children initially. So for example, maybe I want the ViewFlipper to load initially with the 2nd child and not the 1st.

Call setDisplayedChild().

When a child in a ViewFlipper is shown, how can I get that child's index?

Call getDisplayedChild().

这篇关于我如何编程显示ViewFlipper的第二个孩子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆