应该很容易,对吗?所以 – 这就是我在
XML中定义的ViewSwitcher(为了简洁省略了Id和布局)
然后在我的Java代码中的某处我有这个代码
ViewSwitcher switcher = (ViewSwitcher) findViewById(R.id.profileSwitcher);
// more code that basically executes background search
// when call comes back - switch
switcher.bringToFront(); // does nothing
// switcher.bringChildToFront(findViewById(R.id.header2)); // no effect ether
它只是没有切换.我为API v.3(1.5)开发,令我惊讶的是,很少有人对ViewSwitcher的引用.我错过了一些明显的东西吗?
附:我刚刚通过蛮力发现这是有效的:
switcher.setDisplayedChild(1);
仍然 – 为什么不带运动带来的运气()?