问题描述
限时送ChatGPT账号..每当我创建一个新项目时,Fragment_main.xml 文件都会添加到我的 Layout 文件夹中,与 Eclipse 不同的是,这个文件包含通常在 Activity_Main.xml 文件中的内容.为什么 Fragment_main.xml 文件总是添加到我在 Android Studio 中的项目中,它与常规"Activity_main.xml 文件有何不同?
When ever i create a new project, the Fragment_main.xml file is added to my Layout folder and unlike in Eclipse it is this file that contains what is normally in the Activity_Main.xml file.Why is the Fragment_main.xml file always added to my projects in Android Studio and how is it different from the "regular" Activity_main.xml file?
推荐答案
Activity_main.xml 包含 FragmentActivity 的 Layout,fragment_main.xml 是 Fragment 的 Layout.
The Activity_main.xml contains the Layout for the FragmentActivity and the fragment_main.xml is the Layout for the fragment.
有关片段的更多信息以及如何使用它.
访问:http://developer.android/training/basics/fragments/index.html
For more information to fragments and how you can use it.
Visit: http://developer.android/training/basics/fragments/index.html
这篇关于Android Studio 中的 Acitvity_Main.xml 和 Fragment_main.xml 文件有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论