【问题标题】:Category SideMenu with button SWIFT带有 SWIFT 按钮的类别 SideMenu
【发布时间】:2015-08-05 23:55:03
【问题描述】:

我目前正在开发一个应用程序,它允许用户按标题、类别、价格和位置进行研究。

to be more user-friendly, i'm trying to create a sidemenu, which contains all category under the form of button, and when the button is select, the textfield will take the name of the category. 此外,我希望在点击类别文本字段时出现侧边菜单。

我使用 SWRearViewController,作为侧边菜单,但我不知道如何实现上面列出的功能。

这是我想要创建的示例:

感谢您的帮助!

【问题讨论】:

    标签: ios swift button textfield residemenu


    【解决方案1】:

    您应该为所有类别按钮设置回调。一旦这些被触发,您应该获取类别文本字段的实例并设置其文本,例如

    func artsCategoryTapped(aButton: UIButton) {
    categoryTextField.text = "Arts"
    }
    

    我不确定SWRearViewController 是如何工作的,但是如果您知道如何触发它,您可以为您的类别文本字段设置委托方法。一旦你知道有人开始编辑它,你应该显示你的SWRearViewController

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多