Android Market的类的TabBar [英] Android Market-like tabbar

查看:158
本文介绍了Android Market的类的TabBar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是实现一个Android市场类似的TabBar的最佳方式(应用程序/游戏/下载)?

What's the best way to implement an Android Market-like tabbar (Apps/Games/Downloads)?

这将是巨大的,如果我可以用TabHost,但我相信它不允许定制这个水平。

It would be great if I could use TabHost, but I believe it doesn't allow this level of customization.

推荐答案

正如克里斯蒂安说,这是绝对有可能使用 TabHost ,你甚至不需要使用在androidtabs code,他链接到。由于SDK 4级(即Android 1.6的),你可以通过一个查看到<一个href="http://developer.android.com/reference/android/widget/TabHost.TabSpec.html#setIndicator(android.view.View)"相对=nofollow> TabHost.TabSpec.setIndicator() ,这将让你彻底控制标签的外观。

As Cristian said, it's definitely possible using a TabHost, and you don't even need to use the androidtabs code that he links to. As of SDK level 4 (i.e. Android 1.6) you can pass a View to TabHost.TabSpec.setIndicator(), which will allow you to completely control the look of the tabs.

不过,攻要么这些按钮的市场开辟了一个新的活动,正因为如此,使用简单的按钮 S可能会发生更密切地反映比TabHost的行为会

However, tapping either of those buttons in the Market opens up a new Activity, and as such, using simple Buttons might more closely reflect that behaviour than a TabHost would.

在你需要支持1.5和的情况下,你可以从的这个帖子。它包含了Android 1.6 TabHost等。这个复制到你的项目应该工作,即使是在Android 1.5。然后,您将有setIndicator(查看V)提供给你。

In the event that you need to support 1.5 as well, you could check out the zip archive from this post. It contains TabHost etc. from Android 1.6. Copying this into your project should work, even on Android 1.5. You'll then have setIndicator(View v) available to you.

这篇关于Android Market的类的TabBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆