Xamarin.forms.ListView - GroupHeader - 我们可以绘制父母的边界

时间:2018-05-31 15:02:05

标签: android xamarin.forms xamarin.forms.listview

我在Xamarin.Forms上制作了一个自定义Listview事件,按日期分组。我想在我的GroupHeader模板中添加一个图标,如下所示:

What I want

对于iOS:没问题,我的图标超出了他父母的界限。 对于Android:图标不超过他父母的界限,我有这个:

What I have on Android

你能帮帮我吗? Android有可能吗? 这是我的XAML代码:

<!-- calendar + list -->
<StackLayout x:Name="stackPrincipal" Orientation="Vertical" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Margin="0" Spacing="0">

    <!-- CALENDAR -->
    <Controls:WeekCalendarView x:Name="weekCalendarView" ReloadList="ReloadMondaniteListe"></Controls:WeekCalendarView>

    <!-- LIST -->
    <ListView x:Name="ListViewMondanite"
          Margin="0"
          RowHeight="60"
          HorizontalOptions="CenterAndExpand" 
          IsGroupingEnabled="True"
          BackgroundColor="Transparent"
          HasUnevenRows="True"
          ItemTapped="ListMondanite_TappedAsync"
          SeparatorColor="{StaticResource separatorDark}"
          GroupDisplayBinding="{Binding Key}">
        <ListView.GroupHeaderTemplate>
            <DataTemplate>
                <ViewCell Height="30">
                    <AbsoluteLayout HorizontalOptions="FillAndExpand" BackgroundColor="{StaticResource secondaryColor}" VerticalOptions="FillAndExpand">

                        <Label Text="{Binding Key}" AbsoluteLayout.LayoutBounds="0,0,1.01,1.01" AbsoluteLayout.LayoutFlags="All" Margin="20,0,0,0" VerticalOptions="Center" Style="{StaticResource TextSmallWhite}" />
                        <Controls:CircleImageButton AbsoluteLayout.LayoutBounds="0.9,0.5,80,80" AbsoluteLayout.LayoutFlags="PositionProportional" VerticalOptions="Center" 
                                                    Padding="0,-20,0,-20" ImageSource="{local:ImgFromRes Top500.Images.Events.ic_event_calendrier.png}" />
                    </AbsoluteLayout>
                </ViewCell>
            </DataTemplate>
        </ListView.GroupHeaderTemplate>
        <ListView.ItemTemplate>
            <DataTemplate>
                <Controls:ListMondaniteTemplate></Controls:ListMondaniteTemplate>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
</StackLayout>

我已尝试过:绝对布局,相对布局,网格......无效。

谢谢!

0 个答案:

没有答案