你如何本地化 WatchKit 菜单项?
How do you localize WatchKit menu items?
除了强制触摸菜单中的项目外,我的 WatchKit 应用程序都在代码中使用 NSLocalizedString 进行了本地化。我正在使用故事板,而界面生成器似乎无法为我提供菜单或项目的参考。有谁知道我们应该怎么做?
您始终可以通过编程方式创建菜单项,完全绕过故事板,这样您就可以轻松使用本地化字符串。查看 addMenuItemWithImage:title:action:
等的文档:https://developer.apple.com/library/ios/documentation/WatchKit/Reference/WKInterfaceController_class/index.html#//apple_ref/occ/instm/WKInterfaceController/addMenuItemWithImage:title:action:
除了强制触摸菜单中的项目外,我的 WatchKit 应用程序都在代码中使用 NSLocalizedString 进行了本地化。我正在使用故事板,而界面生成器似乎无法为我提供菜单或项目的参考。有谁知道我们应该怎么做?
您始终可以通过编程方式创建菜单项,完全绕过故事板,这样您就可以轻松使用本地化字符串。查看 addMenuItemWithImage:title:action:
等的文档:https://developer.apple.com/library/ios/documentation/WatchKit/Reference/WKInterfaceController_class/index.html#//apple_ref/occ/instm/WKInterfaceController/addMenuItemWithImage:title:action: