在网页屏幕内单击下拉菜单时,我的应用程序(这是一个 ruby motion IOS 应用程序)冻结了。
def thing
open_modal WebScreen.new(
name: "Thing",
url: testURL,
nav_bar: true,
modal: true,
transition_style: UIModalTransitionStyleFlipHorizontal)
end
应用程序被冻结在这样的事情上。此处的用户单击 SelectCategory 按钮,现在无法执行任何操作。http://i.stack.imgur.com/FpZQ3.png
我的控制台输出:
3 月 11 日 14:59:33:CoreAnimation:栅栏 c413 超时
3 月 11 日 14:59:33:CoreAnimation:更新延迟太久
这是我的网络屏幕类:
class WebScreen < PM::WebScreen
# status_bar :none
attr_accessor :url, :name, :id, :thing, :loading
def on_init
self.loading = 0
nav_bar
end
def on_load
# find.screen.webview.scalesPageToFit = true
self.title = @name? @name.upcase : "Thing"
@notifier = Motion::Blitz
end
def content
NSURL.URLWithString(@url)
end
def load_started
if self.loading <= 1
@notifier.loading
self.loading += 1
end
end
def load_finished
@notifier.dismiss
end
def load_failed(error)
# Optional
# "error" is an instance of NSError
end
def shut_screen
@notifier.dismiss
close({ no_load: true, id: self.id })
end
def nav_bar
unless self.coupon
icon = FIEntypoIcon.chevronThinLeftIcon
icon_image = icon.imageWithBounds([[0, 0], [20, 20]], color: UIColor.whiteColor)
set_nav_bar_button :left, image: icon_image, action: :shut_screen
else
set_nav_bar_button :left, title: "Done", style: :plain, action: :close_coupon
end
end
def close_coupon
rmq.app.alert(title: *, message: "Thing will disappear. Please make sure you've used the thing before closing.", actions: :yes_no_cancel, style: :sheet) do |action_type|
case action_type
when :yes
shut_screen
when :no
puts "FINE!"
end
end
end
def back
find.screen.close to_screen: :root
end
end
非常感谢任何信息。