隐藏 UIView
我的 xib 文件中有几个 UIView,并且希望在需要时动态隐藏它们。我下面有以下代码,但由于某种原因它没有隐藏它们。有什么想法我可以做什么吗?
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//hide all the static UIviews
_searchBox.hidden = YES;
_searchButton.hidden = YES;
_logo.hidden = YES;
NSLog(@"FIRED THE EVENT");
//TODO: create a new view that holds a zoomed in image
}
I have several UIViews that are on my xib file and would like to dynamically hide them when I want. I have the following code below but for some reason it's not hiding them. Any ideas what I could do?
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//hide all the static UIviews
_searchBox.hidden = YES;
_searchButton.hidden = YES;
_logo.hidden = YES;
NSLog(@"FIRED THE EVENT");
//TODO: create a new view that holds a zoomed in image
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些 IBOutlet 项目是否已连接到您的 nib 文件中的项目?参考渠道是否有关联?这通常就是原因。
Are theses items IBOutlet connected to the ones in your nib file? And are the referencing outlets linked? That is usually the cause.