问题描述
当我的 WKInterfaceController
按下menuItem(由mainScreen中的 self.addMenuItem
设置时加速) ),加权WKInterfaceController上的标题显示 abbrechen
而不是取消
。任何人都知道如何解决它,使其显示取消
?或者我喜欢在哪里犯错?
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)上运行
时,它工作正常,显示
取消。 - 我的Langauge&地区都是英国人。我的Watch App中的Langauge& Region和我的iPhone设置都是语言英语和澳大利亚地区。
- abbrechen是德语中的abort或cancel。 / li>
- 有一个。
- 也许我在某处更改了langauge的一些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.
我想我可能会改变一个只在Apple改变语言环境/语言的地方看。或者这可能是一个罕见的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中模态segue的标签“取消”显示错误的文字 - “abbrechen”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!