Merge branch 'hotfix/radioGroupBox' into 'release/20_1_0'

fixed bug in radiobox

See merge request BPHV_MIPS/vds_ios!285
This commit is contained in:
Bruce, Matt R 2024-08-12 17:28:29 +00:00
commit f0ceaf11ff

View File

@ -67,17 +67,26 @@ open class RadioBoxGroup: SelectorGroupBase<RadioBoxItem>, SelectorGroupSingleSe
// MARK: - Overrides // MARK: - Overrides
//-------------------------------------------------- //--------------------------------------------------
private func ensureDevice() { private func ensureDevice() {
var axis: NSLayoutConstraint.Axis = .vertical
var distribution: UIStackView.Distribution = .fill
defer {
mainStackView.axis = axis
mainStackView.distribution = distribution
}
if UIDevice.isIPad { if UIDevice.isIPad {
mainStackView.axis = .horizontal axis = .horizontal
mainStackView.distribution = .fillEqually distribution = .fillEqually
} else { } else {
guard let supportedOrientations = UIApplication.shared.windows.first?.rootViewController?.supportedInterfaceOrientations else {
return
}
let orientation = UIDevice.current.orientation let orientation = UIDevice.current.orientation
if orientation == .landscapeLeft || orientation == .landscapeRight { if supportedOrientations.contains(.landscape) && (orientation == .landscapeLeft || orientation == .landscapeRight) {
mainStackView.axis = .horizontal axis = .horizontal
mainStackView.distribution = .fillEqually distribution = .fillEqually
} else {
mainStackView.axis = .vertical
mainStackView.distribution = .fill
} }
} }
} }