回复: [iosdevtips] 在自定义UITableViewCell的contentView中添加Button按钮,点击Button没有响应

2 views
Skip to first unread message

Tang Qiao

unread,
Jan 8, 2014, 9:49:01 AM1/8/14
to liyou0203, iOSDe...@googlegroups.com
你的contentView的frame看起来有点奇怪,为什么宽高都是0?
从你的代码看不出问题,出问题的地方肯定不在这几行代码上,应该是其它地方没写对。

-- 
唐巧

已使用 Sparrow

已使用 Sparrow

在 2014年1月7日 星期二,下午5:43,liyou0203 写道:

如题,自定义cellView,然后
[self.contentView addSubView:myBtn];
点击myBtn,没有响应。

NSLog(@"%@", self.contentView);

输出结果:<UITableViewCellContentView: 0x1445d560; frame = (0 0; 0 0); layer = <CALayer: 0x1445d340>>

如果

[self addSubView:myBtn];
点击myBtn就没问题。

能力有限,google不到想要的答案。

--
您收到此邮件是因为您订阅了 Google 网上论坛的“iOS开发”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 iOSDevTips+...@googlegroups.com
要向此网上论坛发帖,请发送电子邮件至 iOSDe...@googlegroups.com
通过以下网址访问此论坛:http://groups.google.com/group/iOSDevTips。
要在网络上查看此讨论,请访问 https://groups.google.com/d/msgid/iOSDevTips/1fae7b26-e50a-4524-aec1-a6110126f820%40googlegroups.com。
要查看更多选项,请访问 https://groups.google.com/groups/opt_out。

Reply all
Reply to author
Forward
0 new messages