Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/257.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 包裹面板:无法显示多个按钮_C#_Silverlight_Visual Studio 2010_Windows Phone 7 - Fatal编程技术网

C# 包裹面板:无法显示多个按钮

C# 包裹面板:无法显示多个按钮,c#,silverlight,visual-studio-2010,windows-phone-7,C#,Silverlight,Visual Studio 2010,Windows Phone 7,我无法看到所有三个按钮。只有第一个按钮可见。以下是代码: <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <!

我无法看到所有三个按钮。只有第一个按钮可见。以下是代码:

 <Grid x:Name="LayoutRoot" Background="Transparent">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!--TitlePanel contains the name of the application and page title-->


    <Image Name="Title_image" Stretch="Uniform"  Source="Title.png" Margin="0,0,0,60" Grid.Row="1" Visibility="Visible" />

    <!--ContentPanel - place additional content here-->
    <toolkit:WrapPanel Name="empty" Orientation="Horizontal" Grid.Row="1"  >
        <Button  Margin="0,695,336,-13"  Click="On_PhotoClick" Height="83" Width="124">
            <StackPanel Orientation="Vertical">
                <Image Source="ic_right.png" Height="23" Width="53" />
                <TextBlock Text="  Photo" Height="27" FontSize="17" Width="67" />
            </StackPanel>
        </Button>
        <Button Margin="179,702,170,-13"  BorderBrush="#FF867F7F" Background="#009A8E8E" >
            <StackPanel Orientation="Vertical">
                <Image Source="icon_list_a.png"  />
                <TextBlock Text="  List" Height="33" FontSize="20" />
            </StackPanel>
        </Button>
        <Button  Margin="367,702,-12,-13" >
            <StackPanel Orientation="Vertical">
                <Image Source="icon_list_a.png" />
                <TextBlock Text="Information" Height="33"  FontSize="20"/>
            </StackPanel>
        </Button>
    </toolkit:WrapPanel>
</Grid>


是否有人能提出问题所在

设置堆叠面板内的高度和宽度图像

<Image Source="ic_right.png" Height="23" Width="53" />

那么你需要这样的东西:

<Grid x:Name="LayoutRoot"
      Background="Transparent">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <!--TitlePanel contains the name of the application and page title-->
    <Image Name="Title_image"
           Stretch="Uniform"
           Source="Title.png"
           Grid.Row="0"
           Visibility="Visible" />
    <!--ContentPanel - place additional content here-->
    <toolkit:WrapPanel Name="empty"
                       Orientation="Horizontal"
                       Grid.Row="1"
                       ItemWidth="128"
                       ItemHeight="128">
        <Button Click="On_PhotoClick">
            <StackPanel Orientation="Vertical">
                <Image Source="ic_right.png" />
                <TextBlock Text="Photo"
                           FontSize="20" />
            </StackPanel>
        </Button>
        <Button>
            <StackPanel Orientation="Vertical">
                <Image Source="icon_list_a.png" />
                <TextBlock Text="  List"
                           FontSize="20" />
            </StackPanel>
        </Button>
        <Button>
            <StackPanel Orientation="Vertical">
                <Image Source="icon_list_a.png" />
                <TextBlock Text="Information"
                           FontSize="20" />
            </StackPanel>
        </Button>
    </toolkit:WrapPanel>
</Grid>

注意事项:

  • 顶部图像有错误的
    网格。行
    。(它是1(第二行),应该是0(第一行))
  • 要指定统一的高度/宽度,请使用WrapPanel的ItemHeight/ItemWidth属性
  • 避免使用这些难看的边距。通常由设计师生成。一定要把它们清理干净
  • 避免为单个项目指定明确的高度/宽度

这些难看的利润是干什么的?你试过删除它们吗?谢谢你的回复。如果边距不好,我很抱歉。我是windows phone 7的新手。我删除了它们。。现在我可以看到按钮,但我希望按钮在图像“Title\u image”下方水平对齐。现在按钮在图像上方很多。我只设置了VerticalAlignment=“Bottom”,就可以在图像下方对齐