UBottomSheet
UBottomSheet copied to clipboard
Bottomsheet initial position wrong
In ViewController i've set
override func viewWillLayoutSubviews() {
guard sheetCoordinator == nil else {return}
sheetCoordinator = UBottomSheetCoordinator(parent: self)
}
and when click button in ViewController
let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "PAHT_MoiTruongViewController") as! PAHT_MoiTruongViewController
vc.sheetCoordinator = sheetCoordinator
vc.dataSource = MyDataSource()
sheetCoordinator.addSheet(vc, to: self)
and MyDataSource()
class MyDataSource: UBottomSheetCoordinatorDataSource {
func sheetPositions(_ availableHeight: CGFloat) -> [CGFloat] {
return [0.1, 0.6, 0.91].map{$0*availableHeight}
}
func initialPosition(_ availableHeight: CGFloat) -> CGFloat {
return availableHeight*0.1
}
}
but when initial sheet first time, position of sheet show wrong look like this
but when i drag up, it can expand look like this, and that is what i want.
How can i fix it? Thank in advance
@minhson95th did you ever manage to fix this issue? I am getting this error as well. @OfTheWolf please your verdict on this issue?
I have the issue too, on iOS 16, iPhone 14, whatever value greater 0.7 does not work, I want it expand to the top.