Промоушен RubyMotion для iOS
Я получаю остановку в моем приложении (которое представляет собой приложение IOS для Ruby Motion) при нажатии на выпадающий список внутри веб-экрана.
def thing
open_modal WebScreen.new(
name: "Thing",
url: testURL,
nav_bar: true,
modal: true,
transition_style: UIModalTransitionStyleFlipHorizontal)
end
приложение зависает на что-то вроде этого. Пользователь здесь нажимает кнопку SelectCategory и теперь ничего не может сделать.
Моя консоль выводит это:
11 марта 14:59:33: CoreAnimation: тайм-аут забора c413
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
Любая информация с благодарностью.
1 ответ
Вот наконец-то разобрался. Не знаю почему, но когда вы устанавливаете фоновое представление UITableView с изображением, оно блокирует веб-представление, когда пытается открыть раскрывающийся список. Так что не знаю, как решить, но я просто установил цвет фона UITableView, и это, кажется, остановило замораживание