ios - 单击 float 按钮(ActionButton)直接转到另一个 View Controller (不生成 float 按钮选项)

标签 ios swift floating-action-button

我正在使用第三方 ActionButton 在我的应用程序中显示 float 按钮。现在,当我单击 float 按钮时,我想直接转到另一个 viewcontroller ,即我不想生成单击 float 按钮时通常显示的选项,我想转到另一个viewcontroller直接。

我再次使用第三方ActionButton。使用过这个第三方的人也许可以更快地发现这个问题......:)

提前致谢......:)

最佳答案

问题可以解决...

我们使用第三方 ActionButton 为任何 View 显示 float 按钮,如下所示...

actionButton = ActionButton(attachedToView: self.view, items: [])
actionButton.action = { button in
            //the viewcontroller to be shown can be loaded here...     
nil)

这里,在第一行中,items 数组包含单击 float 按钮时要显示的所有选项。但是,如果我们不希望在单击 float 按钮时出现任何选项,则可以将 items 数组留空,就像我在这里所做的那样。

然后在上面的 actionButton.action 中,我们可以加载所需的 View Controller ,正如我上面所指出的。

这样做会导致在单击 float 按钮时直接进入我们选择的viewcontroller,而不会出现选项...

关于ios - 单击 float 按钮(ActionButton)直接转到另一个 View Controller (不生成 float 按钮选项),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46054733/

相关文章:

c++ - Cocos2dx InApp Purchase for ios

ios - 在iOS中找到封闭对象内部的区域

ios - 应用 AVVideoComposition 后视频旋转

swift - 设置后更改固定的物理体位置

android - 当 snackbar 动画开始时, float Action 按钮会上下跳跃

java - iOS 日历的 Android 对应物是什么?

ios - 以编程方式添加前导约束会使应用程序崩溃

ios - 在 Swift 中创建 PDF

android - 如何使用支持库 23 修复缩放的 FloatingActionButton 上的阴影

android - 无法使用 RecyclerView 在 DrawerLayout 中的标题和项目之间放置 float 操作按钮 (FAB)