Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在今天的视图扩展中显示图像视图,但它没有出现。任何想法我做错了什么?
如果您正在重用主项目中的图像,请确保将其复制到 Widget 项目的“复制捆绑资源”部分中。
问题不在于图像没有出现。问题是什么都没有出现。原因是您没有使用内部约束来调整小部件的大小,因此您的小部件没有大小。(理论上,您可以使用 来调整小部件的大小preferredContentSize,但我认为这并不可靠。)
preferredContentSize