gpt4 book ai didi

xcode - 防止选择时更改 NSPopUpButton 的标题

转载 作者:行者123 更新时间:2023-12-03 17:09:38 25 4
gpt4 key购买 nike

我有一个没有标题的 NSPopUpButton。我为这个弹出按钮设置了一个 NSImage。当我将内容值绑定(bind)到带有字符串的数组(以创建演示)时,弹出按钮的标题将更改为数组的值。

有没有办法保留图像并防止标题更改?

谢谢!

最佳答案

这就是NSPopUpButton的工作原理,它显示选择。如果你想用它来触发一个 Action ,请将类型设置为“Pull Down”。数组中的第一项是标题。

The NSPopUpButtonCell class defines the visual appearance of pop-up buttons that display pop-up or pull-down menus. Pop-up menus present the user with a set of choices, much the way radio buttons do, but using much less space. Pull-down menus also provide a set of choices but present the information in a slightly different way, usually to provide a set of commands from which the user can choose.

关于xcode - 防止选择时更改 NSPopUpButton 的标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42587033/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com