Android:为什么我不应该在选项卡中使用活动? [英] Android: Why shouldn't I use activities inside tabs?

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

问题描述

我在一些地方读到过,我不应该将活动用作标签的内容.我想知道为什么这不是推荐的方法...有什么建议吗?

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.

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

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