【问题标题】:Apostrophe in NativeScript App name is not working for Android/ios deploymentNativeScript 应用程序名称中的撇号不适用于 Android/ios 部署
【发布时间】:2018-10-17 00:35:19
【问题描述】:

我正在开发一个 NativeScript 应用程序,我想在 google play store 上发布该应用程序,并在其名称中使用撇号,例如Naren 的应用程序。 它在 ios 上运行良好,因为我必须按照this 示例中的描述更改 info.plist 文件。 但对于 Android,它会在 ('s) 之后修剪名称,并将其作为 Naren 而不是 Naren 的应用程序部署在设备/模拟器上。

这是我的 AndroidManifest.xml 中的代码

<application
        android:name="com.tns.NativeScriptApplication"
        android:allowBackup="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">

在 strings.xml 中(在 values 和 values-v21 文件夹中)

<resources>
    <string name="app_name">Naren's Orders Dev</string>
    <string name="title_activity_kimera">Naren's Orders Dev</string>
</resources>

有人经历过吗?

【问题讨论】:

    标签: android ios nativescript


    【解决方案1】:

    我在android资源here上找到了解决方案。他们说

    处理特殊字符

    当字符串包含在 XML 或 Android 中具有特殊用途的字符时,您必须对这些字符进行转义。一些字符可以通过使用前面的反斜杠进行转义,而另一些则需要 XML 转义。撇号和单引号也可以通过将整个字符串括在双引号中来处理。一些例子如下所示:

    单引号 (')
    以下任何一项:

    &apos;
    
    \'
    
    Enclose the entire string in double quotes ("This'll work", for example)
    

    我首先尝试使用&amp;apos;,但那没有工作,但\'s 工作。在这里发布它可能对其他人有用。

    编辑:

    &amp;apos; 正在使用 ios,但它正在为 Replace normal space with unicode &amp;#x2007; 修剪空白空间

    【讨论】:

      猜你喜欢
      • 2017-06-18
      • 2016-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-30
      相关资源
      最近更新 更多