- AliciaCastillo
- Posts: 16
- Joined:
Sizes for mobile views in mobile Unity simulator.
Hello Again!
Today I come here to ask about mobile development.
So i'm working with visual studio 2022 and Unity. I've developed the desktop LoginView for our software and now I'm developing the mobile version for this View. I've created a separated XAML file for mobile version since this one has some visual changes and I've come across this issue:
When I run the Xaml file for mobile on unity i set this xaml in the noesis view and I execute the Simulator for mobile. The problem is that when I change between the diferent devices tha unity offers (from Iphone 12 to Xaomi Redmi 4 for example) I'm having diferent margin from the simulator border to my content, I'm not sure if this is something that I might be doing wrong or if this something that happens when using this emulator.
I'd like to ask if are there any examples for mobile development in unity or if you recomend using another emulator to test, also if you have any recomendations about how to manage sizes for mobile, I'm used to work with xamarin and there I used to manage sizes differentlyso maybe I'm doing something wrong.
Thanks beforehand!
Today I come here to ask about mobile development.
So i'm working with visual studio 2022 and Unity. I've developed the desktop LoginView for our software and now I'm developing the mobile version for this View. I've created a separated XAML file for mobile version since this one has some visual changes and I've come across this issue:
When I run the Xaml file for mobile on unity i set this xaml in the noesis view and I execute the Simulator for mobile. The problem is that when I change between the diferent devices tha unity offers (from Iphone 12 to Xaomi Redmi 4 for example) I'm having diferent margin from the simulator border to my content, I'm not sure if this is something that I might be doing wrong or if this something that happens when using this emulator.
I'd like to ask if are there any examples for mobile development in unity or if you recomend using another emulator to test, also if you have any recomendations about how to manage sizes for mobile, I'm used to work with xamarin and there I used to manage sizes differentlyso maybe I'm doing something wrong.
Thanks beforehand!
-
sfernandez
Site Admin
- Posts: 3112
- Joined:
Re: Sizes for mobile views in mobile Unity simulator.
Hello,
The simulator seems to be defining different resolutions and scales, and Noesis should adapt just fine. I've tried with the Login sample included in our package and it works as expected in all the simulator devices I tried.
iPhone 12 on the left vs Xiaomi Redmin 4 on the right: .
Make sure your xaml design is not tied to a fixed aspect ratio, or it will leave margins when the aspect ratio changes.
The simulator seems to be defining different resolutions and scales, and Noesis should adapt just fine. I've tried with the Login sample included in our package and it works as expected in all the simulator devices I tried.
iPhone 12 on the left vs Xiaomi Redmin 4 on the right: .
Make sure your xaml design is not tied to a fixed aspect ratio, or it will leave margins when the aspect ratio changes.
- AliciaCastillo
- Posts: 16
- Joined:
Re: Sizes for mobile views in mobile Unity simulator.
Hi, thanks for your answer,
when you say tied to a fixed aspect ratio you mean having a fixed width and height for the main container right?
I'll check my fixed sizes then, thanks!
when you say tied to a fixed aspect ratio you mean having a fixed width and height for the main container right?
I'll check my fixed sizes then, thanks!
-
sfernandez
Site Admin
- Posts: 3112
- Joined:
Re: Sizes for mobile views in mobile Unity simulator.
Exactly, if you have your root container set to a fixed width/height (for example 1920x1080), even if you wrap it with a Viewbox it won't be able to scale properly to other aspect ratios without stretching or leaving margins.when you say tied to a fixed aspect ratio you mean having a fixed width and height for the main container right?
- AliciaCastillo
- Posts: 16
- Joined:
Re: Sizes for mobile views in mobile Unity simulator.
Okay, I see it clearer now, thanks!
Who is online
Users browsing this forum: Bing [Bot] and 2 guests