gpt4 book ai didi

ios - 无法分配给属性 : 'width' is a get-only property

转载 作者:行者123 更新时间:2023-12-03 22:53:34 25 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





self.image.frame.width = 20 give get only property error

(3 个回答)


3年前关闭。




我是 swift 的新手。我收到此错误:

Cannot assign to property: 'width' is a get-only property



使用此语句时:
 cell.reciverMsg.frame.width = cell.reciverMsg.text?.characters.count * 2
reciverMsgUILabel .

最佳答案

您需要设置 width框架的size属性(property)。

cell.reciverMsg.frame.size.width = 20
width frame 的属性(property)只是一个只读的方便。请参阅 CGRect 的文档详情。

关于ios - 无法分配给属性 : 'width' is a get-only property,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51298632/

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