【发布时间】:2016-06-23 15:22:42
【问题描述】:
我有一个我想使用的单元格,我只想要一个单元格中的按钮的插座,这样我就可以显示一个下拉菜单。我正在尝试使用此代码制作带有标签的按钮
var dropdownButton: UIButton = (PostCell.viewWithTag(200) as! UIButton)
我在 cellForRowAtIndexPath 中使用它,但问题是我不断收到错误提示
“在“UIView”类型上使用实例成员“viewWithTag”;您的意思是使用“UIView”类型的值吗?
【问题讨论】:
-
viewWIthTag 是一种可用于 UIVIew 类型对象的方法。 POSTCell 不是 UIView。
标签: ios xcode swift button tags