ios - 观看应用程序自定义菜单图像未显示?

标签 ios objective-c watchkit

我只是在创建 watch 应用程序并添加自定义菜单图像,但它没有显示。

得到这个指南 - Menu Image Guideline

并以 png 格式创建了 80x80 的图标。

将其命名为 comment.png。

我做错了什么?有什么帮助吗?

编辑 1- 在 WatchAppImages.xcassets 中添加图像,现在看起来像 - enter image description here

最佳答案

您是否在 WKInterfaceController 中调用了 setContextMenuOptions

- (void) setContextMenuOptions
{
     [self addMenuItemWithImageNamed:imageName title:title action:action];
}

还有,图片添加到哪里了?应该在 WatchAppImages.xcassets 中,而不是在 WatchExtensionImages.assets 中。

此外,您的 png 应该是视网膜显示的名称:iconImage@2x.png 添加到您的 Assets 中下一张图片的蓝色方 block (2x,不是 1x 或 3x):

enter image description here

希望对您有所帮助。

关于ios - 观看应用程序自定义菜单图像未显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29517062/

相关文章:

ios - 在 UIView 上涂鸦 - ios 开发

ios - 从 Laravel 发送 Firebase 推送通知

swift - 如何从我的 WatchKit 应用程序打开 iPhone 上的父应用程序?

ios - Xcode 9.4 Apple Watch 模拟器无法与 iPhone 配对

ios - 为什么CMMotionManager在停止和重新启动后报告不正确的yaw?

iOS/JSON : Store float value in object variable

ios - 从特定的 UIView 隐藏标签?

ios - 是否可以选择多个 MKAnnotationViews?

objective-c - 服务器/客户端无法正确通信(CocoaAsyncSocket)

swift - NSUserDefaults 不适用于带有 Watch OS2 的 Xcode beta