【问题标题】:Image showing in the designer view in VS2013 but not displaying on the phone in wp8图像显示在 VS2013 的设计器视图中,但未显示在 wp8 的手机上
【发布时间】:2014-05-27 08:24:34
【问题描述】:

我想在应用程序的页面内显示一个图像。它显示在 VS2013 的设计器视图中,但是当我在手机上运行应用程序时它没有显示..

以下是 xaml :

<Grid x:Name="LayoutRoot" Background="#FFFFD9">
        <Grid.RowDefinitions>
            <RowDefinition Height="768"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0" Margin="0,10,12,623">

            <TextBlock Text="" Style="{StaticResource PhoneTextNormalStyle}"/>
            <Image HorizontalAlignment="Left" Height="118" Margin="10,0,0,0" VerticalAlignment="Top" Width="448" Source="images/brandlogo.jpg" RenderTransformOrigin="0.729,0.434" Stretch="Fill"/>

        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">

            <StackPanel Grid.Row="0" Margin="170,628,0,0">

                <Image HorizontalAlignment="Left" Height="88" Margin="10,0,0,0" VerticalAlignment="Top" Width="100" Source="images/statusoffline.bmp" RenderTransformOrigin="0.729,0.434" Stretch="Fill"/>

            </StackPanel>
        </Grid>

任何帮助将不胜感激..

【问题讨论】:

  • 图像属性中的 Build Action 字段设置为什么?

标签: image xaml windows-phone-8


【解决方案1】:

确保在 Visual Studio 中图像文件的属性上将 Build 操作设置为 Content。这通常是推荐的。

【讨论】:

  • 奇怪的是一组图像可以工作,但是当我用另一张图像的链接替换源时,它们没有显示出来..
  • 检查您提供网址的方式。是否所有图像都在同一个文件夹中,其中一些显示而一些不显示?
  • 是的,所有图片都在项目目录下的 images 文件夹中
  • 如果 images 文件夹位于根目录,请尝试在开头添加“/”。
  • 是的,它们在根级别。我也试过了。但没有运气:(
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-04-04
  • 2012-06-25
相关资源
最近更新 更多