【问题标题】:How to remove toolbar in rhomobile production build?如何在 rhomobile 生产版本中删除工具栏?
【发布时间】:2015-07-06 07:04:24
【问题描述】:

我试图在 rhomobile 4.0.0 中完全删除工具栏,但 @@toolbar = nil 属性在 rhomobile 4.0.0 生产版本中不起作用。

【问题讨论】:

  • 那么,您已经删除了项目中 application.rb 文件中的注释,现在执行了 @@toolbar = nil 行,但您仍然在屏幕底部设置导航栏?
  • 是的,我已经删除了,但我仍然可以看到导航栏。
  • 在构建项目之前您是否尝试过清理项目?

标签: ruby-on-rails rhomobile rhodes


【解决方案1】:

使用 RhoMobile v5.1.1(目前可用的最新版本)或 RhoMobile Suite v4.0.0(已有近两年的历史,但包含在原始问题中)构建一个新项目,导航栏消失时您在项目的/app/ 文件夹中取消注释application.rb 中的@@toolbar = nil 行:

require 'rho/rhoapplication'

class AppApplication < Rho::RhoApplication
  def initialize
    # Tab items are loaded left->right, @tabs[0] is leftmost tab in the tab-    bar
    # Super must be called *after* settings @tabs!
    @tabs = nil
    #To remove default toolbar uncomment next line:
    @@toolbar = nil
    super

    # Uncomment to set sync notification callback to /app/Settings/sync_notify.
    # Rho::RhoConnectClient.setObjectNotification("/app/Settings/sync_notify")
    Rho::RhoConnectClient.setNotification('*', "/app/Settings/sync_notify", '')

  end
end

这是原始应用程序,由 RhoMobile(带有导航栏)在 Android 设备上运行:

这里是取消注释@@toolbar = nil 行的同一个应用程序:

【讨论】:

  • 我要的是 Rhomobile v4.0.0 而不是 RhoMobile v5.1.1
  • 答案是在旧版本上进行相同的测试。我已经使用 RhoMobile v4.0.0(大约 2 岁)恢复了旧 VM,并且行为相同,取消注释 @@toolbar = nil 消除了设备底部的导航栏。我建议您检查您的设置,尝试重新安装 rhodes gem。我已经在 RhoSimulator 和 Android 上完成了我的测试,并且行为是正确的。您在哪个操作系统上进行测试?
  • 我已经使用 RhoMobile v4.0.0 和 Qt v4.7.4 following the setup instruction in the old documentation 进行了几次测试,一切都按预期工作。我使用过 Visual Studio 2008。我使用 RhoMobile v5.1.1、Qt v5.1.1 和 Visual Studio 2008 进行了另一项测试,没有任何问题。能否请您仔细检查一下您的设置(Visual Studio 版本、Qt 库版本等)?
猜你喜欢
  • 1970-01-01
  • 2019-12-04
  • 1970-01-01
  • 1970-01-01
  • 2022-08-20
  • 1970-01-01
  • 2022-01-06
  • 2023-03-29
  • 1970-01-01
相关资源
最近更新 更多