gpt4 book ai didi

ios - 在 ScrollView subview 中添加自定义 UIButton subview 会导致 CUICatalog : Invalid asset name supplied

转载 作者:行者123 更新时间:2023-11-30 13:46:36 25 4
gpt4 key购买 nike

在 viewDidLayoutSubView() 中,我尝试向我的 ScrollView 添加自定义 uibutton :

let roundedButton = RoundedShadowButton()
roundedButton.frame = CGRectMake(0, self.scrollView.frame.height, 60, 60)
roundedButton.setTitle("+", forState: .Normal)
roundedButton.tag = 1
self.scrollView.addSubview(roundedButton)

我收到以下错误:

2016-01-17 18:51:23.217 momentful[61122:2267703] CUICatalog: Invalid asset name supplied: 2016-01-17 18:51:23.218 momentful[61122:2267703] Could not load the "" image referenced from a nib in the bundle with identifier

为什么会发生这种情况?我怎样才能解决这个问题 ?提前致谢。

最佳答案

我认为您还必须将其作为 subview 添加到 View Controller 的 View 中:

self.view.addSubview(roundedButton)

现在一切都按预期进行。

关于ios - 在 ScrollView subview 中添加自定义 UIButton subview 会导致 CUICatalog : Invalid asset name supplied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34845343/

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