本文介绍了Android的ADT:没有fragment_main.xml,只有activity_main.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想学习如何编程的Andr​​oid应用程序,所以我下载了ADT捆绑,谷歌提供的,我试过下面,让我来创建一个简单的应用程序的教程。然而,在过程中,有几个指令,告诉我打开fragment_main.xml文件,但我的布局/ RES /目录没有这个文件,只有activity_main.xml文件。此外,创建新的Andr​​oid活动的时候,从来就没有一个选项来命名我的片段布局,表明日食只是不因某些原因产生的。我没想到这会是一个问题,在第一个(我刚编辑activity_main代替),直到我意识到教程希望我们使用来自片段类或XML文件中的一些信息。

I'm trying to learn how to program android applications, so I downloaded the ADT bundle that google supplied, and I tried following the tutorial that allowed me to create a simple application. However, during the procedures, there are several instructions telling me to open up the fragment_main.xml file, but my layout/res/ directory did not have this file, only the activity_main.xml file. Furthermore, when creating new Android activities, there was never an option to name my fragment layout, indicating that eclipse just doesn't create it for some reason. I didn't think this would be an issue at first (I just edited activity_main instead), until I realized that the tutorial wanted us to use the some information from the fragment class or xml file.

有谁知道为什么我的Eclipse IDE未创建fragment_main.xml?我会尽量在必要时提供更多的细节。

Does anyone know why my Eclipse IDE is not creating a fragment_main.xml? I will try to supply more details if necessary.

推荐答案

根据您的意见回应表示,我想升级到更高版本(22.6+)会有所帮助,如在的

Based on the versions you indicated in the comment response, I think updating to the later versions (22.6+) would help, as discussed in https://code.google.com/p/android/issues/detail?id=67421

这篇关于Android的ADT:没有fragment_main.xml,只有activity_main.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 15:23