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?
3 Answers
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.

- 121
- 2
-
2This is helpful - I appreciate your response. I was hoping that the there was a way to do this directly in the graphical layout tool. – Karl Oct 11 '11 at 01:54
-
Each xml layout can be viewed in the graphical layout tool. Just not along with you're view flipper (afaik). – preludedrew Oct 12 '11 at 01:34
-
I have broken my layouts into individual pages - it is a shame that I have to do this, but so be it. – Karl Nov 28 '11 at 03:38
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

- 4,055
- 1
- 21
- 17
-
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..... – CrazyLearner May 14 '14 at 06:18
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.

- 131
- 7