安卓:为什么不应该使用内标签的活动? [英] Android: Why shouldn't I use activities inside tabs?

查看:112
本文介绍了安卓:为什么不应该使用内标签的活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读过的,我不应该使用活动作为我的标签内容的几个地方。我想知道这是为什么不推荐的方法...有什么建议?

I've read at a few places that I should not be using Activities as contents of my tabs. I would like to know why this is not a recommended approach... Any suggestions?

推荐答案

我会翻转它周围:为什么要使用活动标签?你要做的就是增加开销和复杂性。只需使用浏览的标签。

I'd flip it around: why would you want to use activities as tabs? All you do is add overhead and complexity. Just use Views for the tabs.

如果你有一些刚刚的的两个标签和一个单独的独立活动,重用视图。

If you have something that just has to be both a tab and a separate standalone activity, reuse the View.

这篇关于安卓:为什么不应该使用内标签的活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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