我有一个应用程序,第一个屏幕用户看到有从服务器获取的数据。该应用程序还具有启动画面,该应用程序正在加载时显示。可以配置启动画面时间吗?
问题 根据用户连接时间的不同,数据可能需要几秒钟才能加载。在这种情况下,启动屏幕出现几秒钟,然后我只看到一个空白(黑色)屏幕再过几秒钟,然后我看到第一个屏幕。我怀疑在从服务器获取数据的时候会出现空白屏幕。我想办法来解决这个问题
问题
- 时间的闪屏显示出来的长度可配置?例如,也许闪屏可以保持直到数据被提取?
- 数据加载时,可以显示某种形式的微调而不是黑屏吗?
更新
这是我如何加载数据
def self.fetch(client, &block)
client.shared.headers["username"] = App::Persistence["username"]
client.shared.headers["token"] = App::Persistence["sessionId"]
client.shared.get('categories') do |result|
if result.success?
ary = result.object
block.call(ary)
end
end
end
,并使用它
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
Color.fetch(AFMotion::Client) do |data|
main_controller = ColorController.alloc.initWithData(data)
@window.rootViewController = UINavigationController.alloc.initWithRootViewController(main_controller)
@window.rootViewController.navigationBar.barTintColor = '#DF533B'.to_color
@window.rootViewController.navigationBar.translucent = true
@window.rootViewController.navigationBar.tintColor = UIColor.whiteColor
@window.rootViewController.navigationBar.setTitleTextAttributes({
UITextAttributeTextColor => UIColor.whiteColor
})
end
@window.makeKeyAndVisible
@window.tintColor = '#DF533B'.to_color
end
添加一个“等待”视图/视图控制器。 – Larme