menu item is enabled, but still grayed out

前端 未结 3 615
-上瘾入骨i
-上瘾入骨i 2021-02-07 12:44

I have a menu with several items created in interface builder. It looks fine there and \'enabled\' is checked.
But when I run application, all menu items are grayed out.

3条回答
  •  别跟我提以往
    2021-02-07 13:16

    Ah, the plague of using NSMenu...

    Check out .

    Usually the implementation will be as simple as:

    - (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
      return [menuItem isEnabled];
    }
    

提交回复
热议问题