ios - Rubymotion:表单更改时自动提交 formotion 表单

标签 ios ios7 rubymotion formotion

当我更改表单中的字段时,我想将 formotion 表单提交到服务器。有人知道是否有更改回调或类似的东西?

我的表格:

class SettingsScreen < PM::FormotionScreen
  title "Settings"
  tab_bar_item title: "Settings", icon: 'settings'

  def table_data
    {
      sections: [
        {
          title: "Settings",
          rows: [
            {
              title: "Start Date",
              key: :start_date,
              type: :date,
              format: :medium
            }, {
              title: "End Date",
              key: :end_date,
              type: :date,
              format: :medium
            }
          ]
        }
      ]
    }
  end

  def on_load
    self.form.on_submit do |form|
      p "submitting!"
    end
  end
end

最佳答案

一种方法是使用 RMQ观察值。

您可以用它做什么的示例(未经测试):

rmq(UITextView).on(:change) do |sender|
  save_something @form.render
end

在行上有一个未记录的(据我所知)on_change 方法,但我不完全确定如何首先获取这些行。

https://github.com/clayallsopp/formotion/search?q=on_change&ref=cmdform

关于ios - Rubymotion:表单更改时自动提交 formotion 表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19146822/

相关文章:

iphone - 我可以在我的应用中禁止系统警报吗?

JavaScript:input.focus() 并显示 Cursor

ios - Objective-C:存储在集合中的 block 的初始化

ios - 顶部/底部位置的UIToolbar外观界面

objective-c - iOS 7 : Removing border from a section of grouped-style UITableView

ios - 检测 iOS 7.1 版本

ios - NS字典 : Find a specific object and remove it

ios - RubyMotion require 方法替代

ios - 如何将 SVGKit 包含到我的 Rubymotion 项目中?

ios - 如何为我的 iOS 导航栏创建水平渐变背景?