隐藏 UIView

发布于 2024-11-04 16:28:05 字数 411 浏览 6 评论 0原文

我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

删除会话 2024-11-11 16:28:05

这些 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文