A Microsoft framework for building cross-platform mobile apps using .NET and C# with native performance and user interfaces.
Hello,
Welcome to Microsoft Q&A!
Normally there are two ways to solve the problem .
- We use regular layout(e.g StackLayout, Grid) and detect the device rotation with
OnSizeAllocatedmethod in Forms , adjust the UI based on the orientation of the device. protected override void OnSizeAllocated (double width, double height){
base.OnSizeAllocated (width, height);
if (width != this.width || height != this.height) {
this.width = width;
this.height = height;
if (width > height) {
//adjust ui
} else {
//adjust ui
}
}
}- Use RelativeLayout directly , in this way there is no need for procedural code to introduce responsiveness.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.