Apple Watch中模态segue的标签“取消”显示错误的文字 - “abbrechen” [英] The label “Cancel” from modal segue in Apple Watch showing wrong text - "abbrechen"

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

问题描述

当我的 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))
}

线索:

  • It happens only on my Apple Watch device (WatchOS 3.1). When it runs on 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”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆