如何在跑步活动中显示活动?
我想在跑步活动中展示我的活动。我需要类似 html 语言中的框架之类的东西,用于在页面内显示其他页面。我知道Tabhost有这个能力。其他哪一个控件具有这种能力?
谢谢,
I want to show my activities inside of a running activity. I need something like frame in html language that is used for showing other pages inside a page. I know Tabhost has this ability. Which one of other controls has this ability?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Google 在 Android 3.0 及更高版本中引入了片段来创建用户界面的一部分在活动中。但它不是两个 Activity,因为 Activity <>窗户。对于较低版本,您可以在 Activity 中手动加载 xml 布局。
Google introduced fragments in Android 3.0 and upper to create a portion of user interface in an Activity. But it is not two Activity, becuase activity <> window. For lower version you can manually load xml layout in your activity.
Fragment API 确实是您的最佳选择,它非常易于使用您可以将它们动态添加到您的活动布局中(查看 Framgent For All - google 文章)通过使用 FragmentManager 的代码,这个功能从 3.0 开始就已经有了,尽管 Google 还发布了一个非常好的兼容性包,您可以从 SDK Manager 下载并添加到你的项目像这样 所有人的片段:
The Fragment API is really your best choice, it's quite easy to use and you can dynamicly add them to your Activity Layout (take a look to Framgent For All - google Article) by code using the FragmentManager, this feature it's since 3.0 altough Google also released a pretty nice Compatibility Package that you can download out of the SDK Manager and added to your project like this Fragment For All: