4

我觉得我必须在这里忽略一些东西。我已经API Level 10通过 SDK Manager 下载了 API。如果我尝试创建一个新项目,我不能,因为只有Holo主题可用,所有这些都至少需要API Level 11. 我没有其他主题选项,因此“下一步”按钮显示为灰色。有没有办法指定兼容的主题?

4

3 回答 3

3

如果您没有看到 None 选项,请转到这些文件并确保模板配置正确:

{Install_Path}\android-studio\plugins\android\lib\templates\gradle-projects\NewAndroidApplication\template.xml

{Install_Path}\plugins\android\lib\templates\gradle-projects\NewAndroidLibrary\template.xml
{Install_Path}\sdk\tools\templates\projects\NewAndroidApplication\template.xml
{Install_Path}\sdk\tools\templates\projects\NewAndroidLibrary\template.xml

在文本编辑器(Notepad++)中打开每个文件并搜索“baseTheme”。应该有一个具有该 ID 的“参数”xml 元素。

确保参数看起来像这样

<parameter
    id="baseTheme"
    name="Base Theme"
    type="enum"
    default="none"
    help="The base user interface theme for the library">
    <option id="none" default="true">None</option>
    <option id="holo_dark" minBuildApi="11">Holo Dark</option>
    <option id="holo_light" minBuildApi="11">Holo Light</option>
    <option id="holo_light_darkactionbar" minBuildApi="14">Holo Light with Dark Action Bar</option>
</parameter>

而不是这样:

   <parameter
        id="baseTheme"
        name="Base Theme"
        type="enum"
        default="holo_light_darkactionbar"
        help="The base user interface theme for the application">
        <option id="holo_dark" minBuildApi="11">Holo Dark</option>
        <option id="holo_light" minBuildApi="11">Holo Light</option>
        <option id="holo_light_darkactionbar" minBuildApi="14" default="true">Holo Light with Dark Action Bar</option>
    </parameter>

特别是对于文件 '\android-studio\plugins\android\lib\templates\gradle-projects\NewAndroidApplication\template.xml'

于 2013-11-04T21:34:44.643 回答
2

这对我有用:

  1. 转到 [SDK_Folder]\tools\templates\activities\BlankActivity...
  2. 使用 Notepad++(或其他 txt 编辑器)打开 templaste.xml
  3. 找到“X”是您将使用的 API 的行 (minBuildApi=" x ")。

最好的问候, jfidel87

于 2014-04-18T18:10:45.470 回答
0

Android Studio 有更新版本:0.3.1

看这里:http ://tools.android.com/recent

修复了影响“新活动”向导的错误(问题 61258 和问题 61269)

我认为这是一个错误并在此版本中解决。

于 2013-10-25T19:04:51.590 回答