本文介绍了Apple Watch的模式搜索中的“取消"标签显示了错误的文字-&"abbrechen&"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我按下菜单项(由mainScreen中的" self.addMenuItem 设置")弹出我的 WKInterfaceController 时,弹出的WKInterfaceController上的标题显示为" abbrechen ",而不是" Cancel ".有人知道如何解决它,以使其显示" Cancel "吗?还是喜欢我可能在哪里犯了错误?

When my WKInterfaceController poped up by pressing a menuItem (which was settup by "self.addMenuItem in mainScreen"), the title on the poped WKInterfaceController shows "abbrechen" instead of "Cancel". Anyone know how to fix it to make it showing "Cancel"? Or like where did I probably make a mistake?

//MainScreen.swift
func setContextItems(directToEnabled: Bool) {
        self.clearAllMenuItems()
        self.addMenuItem(with: WKMenuItemIcon.decline, title: "direct", action: #selector(MainScreen.freePressed))
}

线索:

  • 它仅在我的Apple Watch设备(WatchOS 3.1)上发生.当它运行时在模拟器(Xcode 8.2.1,iPhone 7 plus)上,可以正常显示取消".
  • 我的语言&地区均为英文.我的Watch App和iPhone设置中的"Langauge& Region"都是英语,而语言则是澳大利亚语.
  • 德语中的"abbrechen"是中止"或取消".
  • 相关问题.
  • 也许我在某些地方更改了用于语言的plist设置.
  • 我搜索了我的项目,但找不到德语","abbrechen"之类的关键字
  • 我确实使用了"#if( TARGET_OS_IOS || TARGET_IPHONE_SIMULATOR )",但没有任何关系.
  • It happens only on my Apple Watch device (WatchOS 3.1). When it runson the simulator(Xcode 8.2.1, iPhone 7 plus), it works fine showing"Cancel".
  • My Langauge & Region are both English. "Langauge & Region" in my Watch App and my iPhone setting are both English for language and Australian for region.
  • "abbrechen" is "abort" or "cancel" in German.
  • There's a related question on SO.
  • Maybe I changed some plist setting for langauge somewhere.
  • I searched my project, and I can not find keywords like "german", "abbrechen"
  • I did used "#if (TARGET_OS_IOS || TARGET_IPHONE_SIMULATOR)", but there's nothing related.

我想我可能会在某个地方更改plist,从而仅在Apple Watch上更改语言环境/语言.也许这是一个罕见的WatchOS错误.有人以前见过类似的问题吗?

I guess I might change a plist somewhere that change the locale/laguage only on the Apple Watch. Or maybe it's a rare WatchOS bug. Anyone saw similar problem before ?

推荐答案

您的代码让我有些困惑吗?您给它的标题为直接",但希望标题为取消"?

I am a bit confused by you code? You are giving it the title 'direct' but expecting a title of 'Cancel'?

您不应该这样做:

    self.clearAllMenuItems()
    self.addMenuItem(withImageNamed: "imageFileForDirectButton", title: "Direct", action: #selector(TheController.menuDirectButtonPressedFunction))
    self.addMenuItem(with: WKMenuItemIcon.decline, title: "Cancel", action: #selector(TheController.menuCancelButtonPressedFunction))

这篇关于Apple Watch的模式搜索中的“取消"标签显示了错误的文字-&"abbrechen&"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 07:40