Windows Phone 8 - 中心 PanoramaItem.Header [英] Windows Phone 8 - Center PanoramaItem.Header

查看:17
本文介绍了Windows Phone 8 - 中心 PanoramaItem.Header的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 Windows Phone 8 开发全景应用程序,但遇到了一个小问题.我在我的 Panorama.Item 之一的标题中添加了一个图像(它显示得很好),但我希望它居中而不是左对齐.我什至不知道这是否可能,或者您是否根本无法更改对齐方式.这是我正在谈论的标题的代码:

I'm developing a Panorama App for Windows Phone 8 and I got a small problem. I added an image to the header of one of my Panorama.Item (and it shows up fine) but I'd love it to be centered and not aligned left. I don't even know if it's possible or if you can't change the alignment at all. Here's the code for the header I'm talking about:

<phone:PanoramaItem.Header>
   <Image x:Name="Logo" Height="100" HorizontalAlignment="Center" Tap="Logo_Tap" />
</phone:PanoramaItem.Header>

不幸的是,Horizo​​ntalAlignment="Center"-Property 似乎没有这样做.任何帮助将不胜感激.

The HorizontalAlignment="Center"-Property unfortunately doesn't seem to do it. Any help would be appreciated.

推荐答案

最简单的方法是:

<phone:PanoramaItem.Header>     
                        <Grid Width="432">
                            <Image x:Name="Logo"
                                   Height="100"
                                   HorizontalAlignment="Center"
                                   Tap="Logo_Tap" />
                        </Grid>
</phone:PanoramaItem.Header>

这篇关于Windows Phone 8 - 中心 PanoramaItem.Header的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆