在Appcelerator Titanium中的Android应用名称中使用感叹号

问题描述 投票:1回答:1

我正在尝试在Appcelerator Titanium项目(目前仅是Android)的App名称中添加一个感叹号,但没有。它在tiapp.xml文件中用红色下划线标明The value 'App!' of element 'name' is not valid(App!不是我的应用程序的实际名称,但是您知道了)。

如果我删除感叹号,那将很高兴。我什至尝试使用ASCII码(!)和Unicode字符(\u0021),但运气不佳。我需要做些特别的事情来做这项工作,还是在Appcelerator Titanium中做不到的事情?

这是我的tiapp.xml文件(为简洁起见,切掉了很多内容]

<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
    <property name="acs-oauth-secret-production" type="string">somenumbers</property>
    <property name="acs-oauth-key-production" type="string">somenumbers</property>
    <property name="acs-api-key-production" type="string">somenumbers</property>
    <property name="acs-oauth-secret-development" type="string">somenumbers</property>
    <property name="acs-oauth-key-development" type="string">somenumbers</property>
    <property name="acs-api-key-development" type="string">somenumbers</property>
    <id>com.myurl.app</id>
    <name>App!</name> <-- Heres my error!
    <version>1.0</version>
    <publisher>robquincey</publisher>
    <url>http://myurl.com</url>
    <description>not specified</description>
    <copyright>2013 by robquincey</copyright>
    <icon>appicon.png</icon>
    <persistent-wifi>false</persistent-wifi>
    <prerendered-icon>false</prerendered-icon>
    <statusbar-style>default</statusbar-style>
    <statusbar-hidden>false</statusbar-hidden>
    <fullscreen>false</fullscreen>
    <navbar-hidden>false</navbar-hidden>
    <analytics>true</analytics>
    <guid>theguid</guid>
    <property name="ti.ui.defaultunit" type="string">system</property>
    <iphone>
        <orientations device="iphone">
            <orientation>Ti.UI.PORTRAIT</orientation>
        </orientations>
        <orientations device="ipad">
            <orientation>Ti.UI.PORTRAIT</orientation>
            <orientation>Ti.UI.UPSIDE_PORTRAIT</orientation>
            <orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
            <orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
        </orientations>
    </iphone>
    <android xmlns:android="http://schemas.android.com/apk/res/android"/>
    <mobileweb>
        <precache/>
        <splash>
            <enabled>true</enabled>
            <inline-css-images>true</inline-css-images>
        </splash>
        <theme>default</theme>
    </mobileweb>
    <modules>
        <module platform="commonjs">ti.cloud</module>
    </modules>
    <deployment-targets>
        <target device="blackberry">false</target>
        <target device="android">true</target>
        <target device="ipad">false</target>
        <target device="iphone">false</target>
        <target device="mobileweb">false</target>
        <target device="tizen">false</target>
    </deployment-targets>
    <sdk-version>3.1.0.GA</sdk-version>
</ti:app>
android titanium appcelerator titanium-mobile appcelerator-mobile
1个回答
2
投票

我相信正确的方法是通过国际化:

http://docs.appcelerator.com/titanium/latest/#!/guide/Internationalization-section-29004892_Internationalization-Internationalizingtheapp%27sname

最简单的方法是转到platform / android / androidmanifest.xml并在此处进行编辑。我在2个位置找到了它,并在两个位置都进行了更改,然后将其部署到模拟器即可。请不要在您所要查找的参考代码下面复制/粘贴代码。

<application android:icon="@drawable/appicon"
    android:label="APPNAME!" android:name="CrmlsApplication"
    android:debuggable="false">

    <!-- TI_APPLICATION -->

    <activity android:name=".myappActivity"
        android:label="APPNAME!" android:theme="@style/Theme.Titanium"
        android:configChanges="keyboardHidden|orientation">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
© www.soinside.com 2019 - 2024. All rights reserved.