片段内的Android TabHost

Android TabHost inside Fragment(片段内的Android TabHost)
本文介绍了片段内的Android TabHost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个 Android 应用程序,并且我使用了 android FragmentPager 选项卡 example 来自 developer.android.com),这个例子使用标签内容的片段,现在我想在其中一个片段中放置一个 tabHost,我已经尽力了,但是第二个选项卡主机没有显示内容,我可以看到选项卡标题但没有内容,我正在尝试将 Intents 用作 TabContent.我不认为我有任何相关的代码可以在这里发布,但是如果你需要我可以在这里发布.

I am working on an Android App and I have used android FragmentPager tabs example from developer.android.com), this example uses fragments for tabs contents, Now I want to place a tabHost inside one of those fragments, I have tried my best but the second tab hosts are not showing the content, I can see tab headers but no content, I am trying to use Intents as TabContent. I don't think I have any relevant code to post here, but If you need I can post it here.

层次结构是:FragmentActivity->TabHost->Fragments->TabHost->(Intent or Fragment,这是问题区域)

The hierarchy is: FragmentActivity->TabHost->Fragments->TabHost->(Intent or Fragment, this is the problem area)

任何建议将不胜感激.

推荐答案

你看到了吗?参考了几次,应该可以帮到你.

Have you seen this? I've referenced it a few times, should help you out.

http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way/

这篇关于片段内的Android TabHost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)