简体   繁体   English

导航抽屉是否暗示嵌套片段?

[英]Navigation Drawer implies nested fragments?

I created an application with a navigation drawer navigating following the android documentation tutorial. 我创建了一个带有导航抽屉的应用程序,它遵循android文档教程进行导航。 Now the main parts of my application are Fragment but the problem is I have to use dynamic fragments in one of them. 现在,我的应用程序的主要部分是片段,但问题是我必须在其中之一中使用动态片段。 I saw the nested fragments were supported since android 4.2, but I need to use my app on older version. 我看到从Android 4.2开始就支持嵌套片段,但是我需要在旧版本上使用我的应用。

What can I do ? 我能做什么 ? I'm thinking of using a FrameLayout of fixed fragments and to set them visible or gone depending of what I need, but it seems a little ugly... 我正在考虑使用固定片段的FrameLayout并根据我的需要将其设置为可见或不可见,但这似乎有点丑陋...

What do you think ? 你怎么看 ? Thanks for your answers 谢谢你的回答

Edit : my question is not clear but what I want to know is : 编辑:我的问题尚不清楚,但我想知道的是:

  • can I use the navigationdrawer with activities instead of fragments ? 我可以将NavigationDrawer与活动一起使用而不是片段吗?
  • is the solution I'm thinking about realy ugly ? 我正在考虑的解决方案真的很丑吗?
  • how can I use the nested fragment system for older version ? 如何将嵌套片段系统用于旧版本?

最后,我使用了Android支持库中的嵌套片段系统(感谢Nobu Games)。感谢您的评论

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM