如何在UITableView顶部添加浮动按钮? [英] How to add floating button on top of the UITableView?

查看:92
本文介绍了如何在UITableView顶部添加浮动按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在UITableViewController顶部添加浮动按钮.

I need to add floating button on top of UITableViewController.

以下链接用于在UIViewController顶部添加FloatingButton动作

The following link is used for adding FloatingButton action on top of UIViewController

在iOS应用程序中创建浮动菜单

我已经尝试将此浮动按钮添加到我的UITableViewController中,但是它不可见.

I already tried to add this floating button to my UITableViewController but it is not visible.

请帮助我 谢谢您提前

推荐答案

  1. 首先添加UITableView,然后添加Button.因此,它在XIB结构中应该是这样的(按钮位于表格之后,而不是之前,否则它将被隐藏):

  1. 设置与超级视图相关但与UITableView不相关的按钮约束.

看到按钮约束与超级视图有关.如果您需要浮动按钮",这一点很重要.

See that button constraints are related to superview. This is important if you want the Floating Button.

如果一切正确完成,它将显示如下:

If everything is done correctly it would show like this:

这篇关于如何在UITableView顶部添加浮动按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆