【问题标题】:iOS RubyMotion Promotion Webscreen FreezeiOS RubyMotion 推广网页冻结
【发布时间】:2016-03-11 23:14:00
【问题描述】:

我的应用程序(这是一个 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

非常感谢任何信息。

【问题讨论】:

  • 这可能不是问题,但title: * 是有效的红宝石吗?
  • 是的,但是当我到达不在优惠券屏幕上的网站时就会发生冻结
  • 其他网站也会出现这种情况吗?该网站在移动 Safari 中表现良好吗?
  • 是的,当我使用移动 safari 或使用 App.open_url() 打开它时,它确实表现良好
  • @LOPHER 你能把屏幕剥离到只剩下必需品,看看它是否仍然发生?如果没有,则一次重新添加一个功能,直到它再次冻结。

标签: ios ruby rubymotion rubymotion-promotion


【解决方案1】:

所以终于想通了。不知道为什么,但是当您使用图像设置 UITableView 背景视图时,它会在尝试打开下拉列表时冻结 Web 视图。所以不知道如何解决,但我只是设置了 UITableView 背景颜色,这似乎已经停止了冻结

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-28
    • 1970-01-01
    • 1970-01-01
    • 2019-06-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多