Graphical Layout shows first view of ViewFlipper, how to see others?
Asked Answered
U

3

8

I am using Eclipse and a ViewFlipper. In Graphical Layout, I want to see the second, third, and forth layouts of my views - right now, I can only see the first view. Any suggestions?

Unteach answered 11/10, 2011 at 0:49 Comment(0)
C
12

If I'm understanding you correctly, you want to see each view in the 'Graphical layout' tool? The way I do this, is instead of having all the layout work done in one xml (where your viewflipper is) I make each view a new layout xml. And then have each view (xml file) included into the view flipper by using this....

<include
layout="@layout/layout_media"
android:id="@+id/flipper_media" />

Hope this helps.

Carricarriage answered 11/10, 2011 at 1:27 Comment(3)
This is helpful - I appreciate your response. I was hoping that the there was a way to do this directly in the graphical layout tool.Unteach
Each xml layout can be viewed in the graphical layout tool. Just not along with you're view flipper (afaik).Carricarriage
I have broken my layouts into individual pages - it is a shame that I have to do this, but so be it.Unteach
S
3

just put each layout in relative layout or linear what ever you are working with then with each layout you will work with the first one in the order and etc.. then at the end put each layout in the order you want later

Selectivity answered 29/1, 2013 at 17:27 Comment(1)
I think this is a nice idea. I have searched a lot to get a direct way to view the second or other parts of a view flipper/ view switcher/ view animator except the first one, but could not find any direct way. So, according to @Yasin Hassanien , the simplest way is to change the order of the parts during designing all parts of a view flipper. After finishing the designing of all parts, then set your desired order of those parts.....Nomology
M
0

I had to subclass the ViewSwitcher class to display an indeterminate ProgressBar until data is ready to display in the second view. I used isInEditMode() to determine whether I was actually running the app or just previewing in AS.

You should be able to add a custom attribute to choose which child to display. This might look a bit overkill, but if you happen to already have to subclass your ViewSwitcher or ViewFlipper, i think it is not a big deal.

I will try to put an example later.

Miyamoto answered 23/5, 2016 at 13:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.