【问题标题】:How to create a rounded first and last viewcell in ListView Xamarin Forms?如何在 ListView Xamarin Forms 中创建圆形的第一个和最后一个 viewcell?
【发布时间】:2016-12-04 18:03:44
【问题描述】:

我想创建下图中提到的ListView。问题是我不想创建一个完整的圆形ListView。我只想要一个矩形ListView 标题和圆形的第一个和最后一个ViewCell?谁能告诉我该怎么做?

【问题讨论】:

  • 你的目标是什么平台?
  • Android 和 IOS 使用 Xamarin Forms

标签: c# xaml listview xamarin.forms cornerradius


【解决方案1】:
You can use this type


  <ListView x:Name="lstView"
            BackgroundColor="White"
            HasUnevenRows="True">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <Grid Padding="0,10,0,15">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="10" />
                                <ColumnDefinition Width="100" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="10" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Image Grid.Column="1" Source="{Binding Image}" />
                            <StackLayout Grid.Column="2" Orientation="Vertical">
                                <Label Text="{Binding Title}" TextColor="#f36e22" />
                                <Label Text="{Binding Text}" TextColor="Black" />
                            </StackLayout>
                            <Image Grid.Column="3" Source="{Binding smallImage}" />
                        </Grid>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

【讨论】:

  • 请评论您的代码。无法通过您的回答来理解您想要达到的目标。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-20
  • 2017-04-12
  • 2019-06-20
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多