开发者

How do I view a different flipper in Layout view of an xml?

开发者 https://www.devze.com 2023-01-26 19:05 出处:网络
H开发者_如何学运维ey all - I am using a flipper in my main xml file to view multiple layouts in my app.

H开发者_如何学运维ey all - I am using a flipper in my main xml file to view multiple layouts in my app.

For instance, if something = 1, the user is shown one version of the flipper, where if something = 2 the user sees a different version.

Is there a way I can view the layout of the xml file for the other flippers I have rather than the main one? Ie, is there a way to switch views of each state of the flipper in eclipse?

Thanks!


I would suggest including all flippers in your xml file. Use android:visibility="gone" for the flippers that won't show by default, or all of them. Then in your code you can toggle them back on with flipper.setVisibility(View.VISIBLE). The others should View.GONE.

For a cleaner XML file (especially if you have a lot of flippers), you can use <include> statements to each flipper source.

0

精彩评论

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