gpt4 book ai didi

ios - 状态栏库不显示

转载 作者:行者123 更新时间:2023-11-29 01:19:40 24 4
gpt4 key购买 nike

我正在使用这个库 https://github.com/marketplacer/Dodo当没有互联网时显示状态栏。但即使这些代码被编译,也没有显示状态栏。我还通过用 UILabel 替换这些 dodo View 进行测试,并且标签显示。但为什么dodo View 无法显示。谁能给我解释一下。

代码如下:

if Reachability.isConnectedToNetwork() {
load()
} else if !Reachability.isConnectedToNetwork() {
view.dodo.style.label.color = UIColor.whiteColor()
view.dodo.style.bar.backgroundColor = DodoColor.fromHexString("#00000090")
view.dodo.style.bar.hideAfterDelaySeconds = 10
view.dodo.style.bar.hideOnTap = true
view.dodo.style.bar.locationTop = true
view.dodo.style.bar.onTap = { /* Button tapped */ }
}

enter image description here

最佳答案

使用更新后的代码:

if Reachability.isConnectedToNetwork() {
load()
} else if !Reachability.isConnectedToNetwork() {
view.dodo.style.label.color = UIColor.whiteColor()
view.dodo.style.bar.backgroundColor = DodoColor.fromHexString("#00000090")
view.dodo.style.bar.hideAfterDelaySeconds = 10
view.dodo.style.bar.hideOnTap = true
view.dodo.style.bar.locationTop = true
view.dodo.style.bar.onTap = { /* Button tapped */ }

view.dodo.show("No Internet")

}

示例 View Controller :

import UIKit

进口渡渡鸟

类 View Controller :UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.

view.dodo.style.label.color = UIColor.whiteColor()
view.dodo.style.bar.backgroundColor = DodoColor.fromHexString("#00000090")
view.dodo.style.bar.hideAfterDelaySeconds = 10
view.dodo.style.bar.hideOnTap = true
view.dodo.style.bar.locationTop = true
view.dodo.style.bar.onTap = { /* Button tapped */ }

view.dodo.show("No Internet")

}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.

}

ScreenSHot

如果仍然无法正常工作,请检查“isConnectedToNetwork”的实现并在代码的其他部分放置一个调试断点。

关于ios - 状态栏库不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34766776/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com