XamarinCommunityToolkit
XamarinCommunityToolkit copied to clipboard
[Bug] iOS Popup: Position of Popup is not centered when the orientation of the device changes
Description
If you change the orientation of the iOS device (e.g. from portrait to landscape mode or vice versa), the Popup is not in the center anymore. On Android this works fine. I guess that is, because the position on iOS is set when initializing to the coordinates of the center of the screen, but the coordinates don't change when the orientation changes.
Steps to Reproduce
- Open the Samples app and open the Popup sample on an iOS device.
- Change the orientation of the device.
Expected Behavior
The popup should still be in the center of the screen.
Actual Behavior
The popup still has the same coordinates, which are not the center of the screen anymore.
Basic Information
- Version with issue: v1.1.0
We are encountering the same issue in our app.
I guess in the same area as #1402
We too, is there any chance someone get fixing this annoying bug?
This appears to still be an issue as of 2.0.2 - any recommendations on a workaround or fix to re-render a popup on rotate
?
Bug is still not fixed?
When opening your popup view subscribe to: Application.Current.MainPage.SizeChanged += MainPage_SizeChanged;
Manually trigger the PropertyChanged event with OnPropertyChanged(nameof(VerticalOptions)) in the SizeChanged event. This will force the PopupRenderer to recenter the popup.