我有一个 iOS 应用程序,它可以在 12 岁以下的所有 iOS 版本上完美运行,在 iOS 13 上单击按钮时它停止响应(崩溃),出现错误XPC connection interrupted,我的应用程序同时使用客观 c 和 swift 语言
我正在尝试使用 Swift 在 iOS 13 上加载带有 WKWebView 的网页。它在 iOS 12 中运行良好。问题是 WKWebView 在 iOS 13 上显示白屏。两者(iOS 12/iOS 13)使用相同的 URL,所以我 100% 确定 URL 中没有问题。这是我加载网页的 UIViewController:
import UIKit
import WebKit
class WebViewController: UIViewController , WKNavigationDelegate{
var param : String!
var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
let url = URL(string: "https://google.com")!
webView.load(URLRequest(url: url))
}
override func loadView() {
webView = WKWebView()
webView.navigationDelegate = self
view = webView
}
}
Run Code Online (Sandbox Code Playgroud)
野生动物园检查员结果:
about:blankwww.google.com在 main 方法中使用以下代码行更改颤动中的底部导航栏颜色时:
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
systemNavigationBarColor: Colors.white,
statusBarColor: Colors.transparent,
));
Run Code Online (Sandbox Code Playgroud)
它工作正常,但在主页内使用 SilverAppBar一段时间后,底部导航栏颜色恢复为黑色:
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
expandedHeight: 300,
floating: false,
pinned: true,
snap: false,
backgroundColor: Colors.white,
flexibleSpace: FlexibleSpaceBar(),
),
SliverList(
delegate: SliverChildListDelegate(<Widget>[
]),
)
],
),
Run Code Online (Sandbox Code Playgroud)
更改 expandedHeight: 250底部导航栏颜色的值时不会改变,所以问题出在expandedHeightvalue内部,那么为什么以及如何解决这个问题。