Android:“新闻和天气”应用程序选项卡
有谁知道如何构建“新闻和天气”应用程序使用的那种选项卡?
请参阅此处 http://img51.imageshack.us/img51/8788/tabsd.png< /a>
这意味着可以向左滚动的选项卡区域正确的。通过向左/右滚动列表视图也可以更改选项卡。
does anyone know how to build that kind of tabs that the "News and Weather" app uses?
see here http://img51.imageshack.us/img51/8788/tabsd.png
This means a tab area that can be scrolled to the left & right. Changing the tabs is also possible by scrolling the listview to the left / right.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有了选项卡后,您可以使用 WorkspaceView 的改编版来完成其余部分: 水平“选项卡”ish在视图之间滚动
编辑:Android SDK 现在支持此功能。请参阅此处: http:// /android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html?m=1
Once you have the tabs, you can use an adaptation of WorkspaceView for the rest: Horizontal "tab"ish scroll between views
EDIT: This is now supported in the Android SDK. See here: http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html?m=1
这些选项卡很容易创建,它是一个带有按钮的水平滚动视图,正如其他人已经提到的那样。内容部分是最难的部分。它可以水平和垂直滚动,因此需要一些魔法。
The tabs are quite easy to create, it's an horizontal scroll view with buttons as someone else already mentioned. The content part is the tough thing. It scrolls both horizontally and vertically, therefore requires some magic.
上面的组件实际上是一个 HorizontalScrollView,里面有按钮。像 LinearLayout 一样使用它并添加按钮。不过,您必须手动处理按钮/选项卡的选定/未选定状态。
That component up there is actually a
HorizontalScrollView
, with buttons inside. Use it like a LinearLayout and throw in the buttons. You'll have to manually handle the selected/unselected states of the buttons/tabs though.