4

Does Windows Phone 7 have anything like iPhone's UITableView?

[Basically, I'm porting an iOS app where the table views worked really well.]

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
William Jockusch
  • 26,513
  • 49
  • 182
  • 323

2 Answers2

4

you can create something similar to Table view using the below XAML Code.

              <ListBox >

                <ListBoxItem>
                    <StackPanel Orientation="Horizontal"   >
                        <Border BorderThickness="3" BorderBrush="#A5FFFFFF" Width="80" Margin="0,20,0,20" Height="60">
                            <Image Source="{Binding ImageUrl, Mode=OneWay}"  VerticalAlignment="Stretch" Margin="0,0,0,0" Width="80" Height="60" Stretch="Fill" />
                        </Border>
                        <TextBlock TextWrapping="Wrap" Text="Foobar" FontSize="40" FontWeight="Normal" VerticalAlignment="Center" Margin="30,0,0,0" />
                    </StackPanel>
                </ListBoxItem>
                <ListBoxItem>
                    <StackPanel Orientation="Horizontal"   >
                        <Border BorderThickness="3" BorderBrush="#A5FFFFFF" Width="80" Margin="0,20,0,20" Height="60">
                            <Image Source="{Binding ImageUrl, Mode=OneWay}"  VerticalAlignment="Stretch" Margin="0,0,0,0" Width="80" Height="60" Stretch="Fill" />
                        </Border>
                        <TextBlock TextWrapping="Wrap" Text="Foobar" FontSize="40" FontWeight="Normal" VerticalAlignment="Center" Margin="30,0,0,0" />
                    </StackPanel>
                </ListBoxItem>
            </ListBox>

The above example will create a table view with two elements .If you want you can Add Border to seperate between each table.

Hope it helps.

Vaysage
  • 1,326
  • 2
  • 15
  • 30
2

I imagine that the closest match is the Grid control, which enables you to define rows and columns and add content to grid cells. You might find the MSDN page How to: Create a Grid Element helpful.

Derek Lakin
  • 16,179
  • 36
  • 51