本文介绍了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))
}

线索:

我想我可能会改变一个只在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”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!