Graphical Layout显示ViewFlipper的第一个视图,如何查看其他视图?
我正在使用 Eclipse 和 ViewFlipper。在图形布局中,我想查看视图的第二个、第三个和第四个布局 - 现在,我只能看到第一个视图。有什么建议吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果我理解正确的话,您想查看“图形布局”工具中的每个视图吗?我这样做的方法是,不是在一个 xml(您的 viewflipper 所在的位置)中完成所有布局工作,而是为每个视图创建一个新的布局 xml。然后使用这个将每个视图(xml 文件)包含到视图翻转器中......
希望这有帮助。
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....
Hope this helps.
只需将每个布局放在相对布局或线性布局中,无论您正在使用什么,然后对于每个布局,您将使用顺序中的第一个布局等等。最后,将每个布局按照您稍后想要的顺序放置
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
我必须对 ViewSwitcher 类进行子类化,以显示不确定的 ProgressBar ,直到数据准备好在第二个视图中显示。我使用了
isInEditMode()
< /a> 来确定我是否实际运行该应用程序或只是在 AS 中预览。您应该能够添加自定义属性来选择要显示的子项。这可能看起来有点矫枉过正,但如果您碰巧已经必须子类化您的
ViewSwitcher
或ViewFlipper
,我认为这没什么大不了的。稍后我会尝试举一个例子。
I had to subclass the
ViewSwitcher
class to display an indeterminateProgressBar
until data is ready to display in the second view. I usedisInEditMode()
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
orViewFlipper
, i think it is not a big deal.I will try to put an example later.