开发者

Table views in Windows Phone 7

开发者 https://www.devze.com 2023-02-12 01:55 出处:网络
Does Windows Phone 7 have anything like iPho开发者_Python百科ne\'s UITableView? [Basically, I\'m porting an iOS app where the table views worked really well.]you can create something similar to Table

Does Windows Phone 7 have anything like iPho开发者_Python百科ne's UITableView?

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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消