After IOS 16 canot change screen orientation with
I found this code can anywhere help me pass to B4X
Thanks for your time.
Orientation:
no.Initialize ("UIDevice").RunMethod ("currentDevice", Null).SetField ("orientation", 3)
I found this code can anywhere help me pass to B4X
Objective-C:
if #available(iOS 16.0, *) {
DispatchQueue.main.async {
let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene
self.setNeedsUpdateOfSupportedInterfaceOrientations()
self.navigationController?.setNeedsUpdateOfSupportedInterfaceOrientations()
windowScene?.requestGeometryUpdate(.iOS(interfaceOrientations: .landscape)) { error in
print(error)
print(windowScene?.effectiveGeometry ?? "")
}
}
}else{
UIDevice.current.setValue(UIInterfaceOrientation.landscapeLeft.rawValue, forKey: "orientation")
}
Thanks for your time.