[英]FontWeight attribute doesn't work [Windows Phone 8.1 Runtime]
此案是真是小巫見大巫:fontWeight設置對屬性TextBlock
不通用商店App工作。 我創建了示例項目(Universal App),並在WindowPhone的MainPage
添加了TextBlock
樣式:
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize=20
FontWeight="Thin"
Text="Test text should be thin in runtime." />
在設計器中,一切看起來都很好,但是當我在模擬器/設備上部署應用程序時,測試文本不會變薄! 這是正常的。 看看截圖:
正如您所看到的,在設計師中,文字非常薄(它很漂亮!)。 但是在運行模擬器中,文本的重量是正常的。 為什么? 我該如何解決它? 在此先感謝您的幫助。
它在WP8.0 Silverlight中運行良好,但在WP8.1運行時,你也需要對它應用<Style>
。 像這樣
<Grid x:Name="ContentPanel">
<StackPanel>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="20" Text="Test text should be normal in runtime."/>
<!-- apply the a style like BodyTextBlockStyle -->
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="20"
Text="Test text should be thin in runtime."
FontWeight="Thin" Style="{StaticResource BodyTextBlockStyle}"/>
</StackPanel>
</Grid>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.