简体   繁体   English

Android操作栏 - 使用标签

[英]Android Action Bar - With Tabs

I am trying to create a tab action bar on android but I seem to face problems when following tutorials. 我正在尝试在Android上创建一个标签操作栏,但我在遵循教程时似乎遇到了问题。 They usually will have resources which are not shown of which I am also not too sure what are they an causing me not being able to compile the project like in the tutorial. 他们通常会拥有未显示的资源,我也不太确定它们是什么导致我无法像在教程中那样编译项目。 can someone kindly help me out with this. 有人可以帮助我解决这个问题。 thanks. 谢谢。

这是我的一本书中介绍的另一个示例项目 ,它演示了操作栏中的选项卡以及其他功能。

Android has many examples in their APIDemos; Android在他们的APIDemos中有很多例子; ActionBarTabs is one of them. ActionBarTabs就是其中之一。

It's important that you set "Theme.Holo" has your application main theme at the Android Manifest. 将“Theme.Holo”设置为Android Manifest中的应用程序主题非常重要。 Any Holo theme will do (Theme.Holo.Light, Theme.Holo.foo.bar) 任何Holo主题都可以(Theme.Holo.Light,Theme.Holo.foo.bar)

Your tag has to be something like this 你的标签必须是这样的

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Holo" >

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM