Unity: Issue with ViewBox/Sizing on iOS after upgrading to 3.12
Posted: 20 May 2021, 06:42
We just upgraded to 3.12 from 3.04, and are running into some sizing/scaling issues on iOS 9(iPad) probably centered around ViewBoxes.
We have an overlay window that we put into a ViewBox over our main game window. We generally want to scale this window to as much of the screen as possible.
If you look at the attached screenshots, things are behaving the way we expect in the Editor and on Android, but on iOS something is not working the same, and the overlay window is not expanding vertically in the same way.
Editor:
https://1drv.ms/u/s!AjEAlWO9Yl9unM5_-EXF0dN2Panvmg
Android:
https://1drv.ms/u/s!AjEAlWO9Yl9unM8BvkmlZlX32V13Yw
iPad:
https://1drv.ms/u/s!AjEAlWO9Yl9unM8AkP0z2a6YNS5TbQ
The XAML that runs the sizing here is as follows:
I cannot easily load the old version onto my iPad right now, but based on our customer complaints when they upgraded today, this was not a problem running on iOS under 3.04. We didn't change any code while doing this upgrade--we were just updating Noesis to get some bug fixes we needed.
Any ideas what might be going on here? Thanks.
We have an overlay window that we put into a ViewBox over our main game window. We generally want to scale this window to as much of the screen as possible.
If you look at the attached screenshots, things are behaving the way we expect in the Editor and on Android, but on iOS something is not working the same, and the overlay window is not expanding vertically in the same way.
Editor:
https://1drv.ms/u/s!AjEAlWO9Yl9unM5_-EXF0dN2Panvmg
Android:
https://1drv.ms/u/s!AjEAlWO9Yl9unM8BvkmlZlX32V13Yw
iPad:
https://1drv.ms/u/s!AjEAlWO9Yl9unM8AkP0z2a6YNS5TbQ
The XAML that runs the sizing here is as follows:
Code: Select all
<Grid Visibility="{Binding DataContext.IsVisible, ElementName=LineupView, Converter={StaticResource BoolToVisConverter}}" Background="{Binding BoundaryColor}" Opacity="{Binding Opacity, ElementName=LineupView}">
<Grid x:Name="LineupModal">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
</Grid>
<Viewbox Stretch="Uniform" StretchDirection="Both" x:Name="LineupViewbox">
<views:LineupView x:Name="LineupView" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="10"
Visibility="{Binding IsVisible, Converter={StaticResource BoolToVisConverter}}"
Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=ActualWidth}"
MaxHeight="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=ActualHeight}"
MaxWidth="2000"
Opponent="False"/>
</Viewbox>
</Grid>Any ideas what might be going on here? Thanks.