Android Studio 中的 Acitvity

编程入门 行业动态 更新时间:2024-10-15 20:17:35
本文介绍了Android Studio 中的 Acitvity_Main.xml 和 Fragment_main.xml 文件有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-15 05:19:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/857608.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Android   Studio   Acitvity

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!