【问题标题】:New project missing xml files and folders新项目缺少 xml 文件和文件夹
【发布时间】:2013-06-03 08:28:38
【问题描述】:
在 Android Studio 上创建新项目时,我的新项目中缺少一些文件,例如:
xml 文件:
activity_main.xml、AndroidManifest.xml
res 文件夹内的文件夹:
布局,值
我不知道是否还有更多的东西丢失。我使用的是 windows 8 专业版
【问题讨论】:
标签:
android
xml
android-studio
new-project
【解决方案1】:
您的 res 文件夹中唯一需要的文件夹可能是其中包含“strings.xml”的“values”。并且您需要在值 fodler 中有一个“styles.xml”。将此文本复制到您的 styles.xml:
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>
标签也必须放在 strings.xml 文件中。
谷歌搜索一个 androidmanifast xml 文件并将其复制到其中。
【解决方案2】:
您还可以在创建项目时检查设置,应该有一个设置,如下所示:
"生成 xml 文件"
只是一些想法