UWPアプリケーションの開発でViewboxを2つ配置したいのですが、2つとも中央に表示されてしまいます。
Viewbox内のTextBlockのVerticalAlignmentをBottomに指定することで可能かと思っていたのですが出来ませんでした。
Borderを利用してメッセージの背景色を指定したいので、Viewbox要素内におさめたいのですのですが
他の方法があれば教えてください。
XAML
1<Page 2 x:Class="FaceDetectedCameraApp.BlankPage" 3 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 4 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 5 xmlns:local="using:FaceDetectedCameraApp" 6 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 7 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 8 mc:Ignorable="d"> 9 10 <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 11 12 <!--中央部のメッセージ--> 13 <Viewbox Stretch="None"> 14 <Border x:Name="GyroAlertBorder" Background="White" CornerRadius="20,20,20,20"> 15 <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,10,10,10" 16 x:Name="GyroAlertText" FontSize="36" Foreground="Black" Text="中央に表示したいメッセージ" /> 17 </Border> 18 </Viewbox> 19 20 <!--下部のメッセージ--> 21 <Viewbox Stretch="None"> 22 <Border x:Name="AnotationBorder" Background="White" CornerRadius="20,20,20,20"> 23 <TextBlock HorizontalAlignment="Center" VerticalAlignment="Bottom" 24 x:Name="AnotationText" FontSize="24" Foreground="Black" Text="下に表示したいメッセージ" ></TextBlock> 25 </Border> 26 </Viewbox> 27 28 29 </Grid> 30</Page> 31
回答1件
あなたの回答
tips
プレビュー