locked
Why is my TextBlock invisible in column 1 and 2?

    Question

  • I want to put a logo to the left of a TextBlock, so I'm trying to add a placeholder image for now. Yet with this XAML:

            <StackPanel Orientation="Horizontal">
                <Image Source="Assets/Logo.png" Margin="4" />
                <TextBlock Style="{ StaticResource HeaderTextStyle}" Grid.ColumnSpan="3" FontSize="80" Margin="20" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="20">Duckbilled Platypi</TextBlock>
            </StackPanel>

     
    ...the TextBlock is now invisible or hidden beneath columns 1 and 2 (second and third columns). So what I see is:

        <logo> "Duc"

    ...when it should be:

        <logo> "Duckbilled Platypi"

    It worked fine until I added the logo, and surrounded them with the horizontal StackPanel.

    Thursday, November 08, 2012 4:04 PM

Answers

  • It is difficult to help you without seeing the whole layout but probably it should looks like this:

    <StackPanel Orientation="Horizontal" Grid.ColumnSpan="3">
       <Image Source="Assets/Logo.png" Margin="4" />
       <TextBlock Style="{ StaticResource HeaderTextStyle}"  FontSize="80" Margin="20" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="20">Duckbilled Platypi</TextBlock>
    </StackPanel>
    or even Grid.ColumnSpan="4"

    Thursday, November 08, 2012 7:48 PM

All replies

  • It is difficult to help you without seeing the whole layout but probably it should looks like this:

    <StackPanel Orientation="Horizontal" Grid.ColumnSpan="3">
       <Image Source="Assets/Logo.png" Margin="4" />
       <TextBlock Style="{ StaticResource HeaderTextStyle}"  FontSize="80" Margin="20" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="20">Duckbilled Platypi</TextBlock>
    </StackPanel>
    or even Grid.ColumnSpan="4"

    Thursday, November 08, 2012 7:48 PM
  • The UI Design for Windows Store apps forum is for language agnostic discussions about designing Windows Store apps. For coding issues (including requests for 3rd party control suggestions) please post in the appropriate forum for the language and UI toolkit you are using.

    Thursday, November 08, 2012 10:53 PM
    Owner