Auras
Auras

Reputation: 7596

How do I align elements in a UWP Windows 10 Mobile app?

I have this simple layout in a Windows 10 Mobile app:

<Page
x:Class="Clock_Mobile.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Clock_Mobile"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" FontFamily="Schnaubelt">

<Grid>
    <Ellipse UseLayoutRounding="True" HorizontalAlignment="Center" Height="20" VerticalAlignment="Center" Width="20" Fill="#FFEBEBEB"/>
    <Ellipse UseLayoutRounding="True" HorizontalAlignment="Center" Height="16" VerticalAlignment="Center" Width="16" Fill="#FFFF9900"/>
    <Ellipse UseLayoutRounding="True" HorizontalAlignment="Center" Height="8" VerticalAlignment="Center" Width="8" Fill="Black"/>
</Grid>

And it looks like this:

The circles are not aligned

The circles are not properly aligned, even though the window width and height are even numbers.

How do I make them align? I'm also ok to use another Control and Graphics API like Graphics2D in Java, but finding documentation right now for this deprecated platform is very hard.

Upvotes: 0

Views: 32

Answers (0)

Related Questions