钛合金材料设计

时间:2016-08-28 00:50:21

标签: android titanium material-design appcelerator titanium-alloy

首先抱歉我的英语! 我对此进行了恳求:http://www.appcelerator.com/blog/2015/07/understanding-the-android-material-theme/一步一步地在我的 Android 应用上使用Material Theme!它适用于Titanium Classic,但不适用于Alloy Framework。这两种方法之间是否存在差异?

使用Alloy我只是看不到有或没有主题的差异。

我收到的错误是:

[ERROR] Detected legacy "/platform" directory in project directory. 
[ERROR] Please move the "/platform" directory to "/app/platform" for Alloy 1.8.0 or later. [ERROR] Alloy compiler failed

但移动/平台到/ app / platform它仍无法正常工作

谢谢你,Luca

编辑:

我找到了可能的修复方法。在我的tiapp.xml中(使用TiShadow生成),我有:

<android xmlns:android="http://schemas.android.com/apk/res/android">
  **POSITION ONE**

  <manifest android:versionCode="6" android:versionName="1.5.0">

    <uses-permission android:name="android.permission.ACCESS_CHECKIN_PROPERTIES" />
       //long list of uses-permission
    <uses-feature android:name='android.hardware.microphone' android:required="false" />
       //long list of uses-features
    <application>
      <meta-data android:name="com.sec.android.support.multiwindow" android:value="true"/>
    </application>
    </manifest>
    **POSITION TWO**
</android>

我必须插入:

<manifest>
        <application android:theme="@style/Theme.Appcelerator"> </application>
</manifest>

如果我将其插入 POSITION ONE ,则不起作用(完全忽略);但如果我将其插入 POSITION TWO ,它可以正常工作。

我尝试了更多次同样的结果。有人能给我一个解释吗? :困惑:

2 个答案:

答案 0 :(得分:0)

首先,请将您的答案添加到其中来编辑您的问题,因为它不是答案。

现在来看你的问题,两个职位背后的原因是:

应用标记必须位于清单标记内,否则将被忽略。

由于清单标记是最顶层的标记,因此忽略了Pos 1,并且清单标记下的其余部分被认为是清单,这就是Pos 2工作的原因。

现在,您已经在使用功能下方添加了应用标记,您只需要添加 android:theme =&#34; @style /Theme.Appcelerator" 属性为应用程序标记。

因此 tiapp.xml 中的最终 android 标记将如下所示:

<android xmlns:android="http://schemas.android.com/apk/res/android">
  <manifest android:versionCode="6" android:versionName="1.5.0">

    <uses-permission android:name="android.permission.ACCESS_CHECKIN_PROPERTIES" />

    <uses-feature android:name='android.hardware.microphone' android:required="false" />

    <application android:theme="@style/Theme.Appcelerator">
      <meta-data android:name="com.sec.android.support.multiwindow" android:value="true"/>
    </application>

  </manifest>
</android>

答案 1 :(得分:0)

仅供参考标记为正确答案的解决方案不再有效,因为Appcelerator将在构建期间删除/ res / values /目录,并且无法找到新创建的主题。截至目前,将你的theme.xml放在app / platform / android /.

相关问题