Android 片段选项卡示例

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10383142/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 03:28:59  来源:igfitidea点击:

Android Fragment Tabs Example

androidandroid-fragmentsandroid-ui

提问by Rookie

I am currently working on 2.3 version of android and I want to switch my app to 4.0 version but the TabActivityis deprecated. So I was looking for working example of FragmentTabsbut I am not able to find one. Can anyone help?

我目前正在开发 2.3 版本的 android,我想将我的应用程序切换到 4.0 版本,但TabActivity已弃用。所以我一直在寻找工作示例,FragmentTabs但我找不到一个。任何人都可以帮忙吗?

回答by wyoskibum

I've found the FragmentTabsexample from the API Demos project to be very useful.

我发现FragmentTabsAPI Demos 项目中的示例非常有用。

Just create a new Android sample project from Eclipse and choose the API demos (try API 13). Also for the support (compatibility) library, there's a FragmentTabs demo in the Support4Demos

只需从 Eclipse 创建一个新的 Android 示例项目并选择 API 演示(尝试 API 13)。同样对于支持(兼容性)库,Support4Demos 中有一个 FragmentTabs 演示

also refer this link Android-FragmentTabHost-demo

另请参阅此链接Android-FragmentTabHost-demo

回答by Chris K.

A great library is ActionBarSherlock. You can find it here. There are many examples and demos even for fragments.

ActionBarSherlock 是一个很棒的库。你可以在这里找到它。即使是片段,也有许多示例和演示。

回答by Haspemulator

It's worth mentioning that Google introduced ActionBarCompatin the v7 appcompat library (together with Android 4.3) yesterday. Here's a video overview, and here's documentation.

值得一提的是,谷歌ActionBarCompat昨天在 v7 appcompat 库(连同 Android 4.3)中引入了。这是视频概述,这是文档