嗨,我有一个列表视图,在其中添加了ContextActions。
我需要在上下文操作中更改文本大小,菜单项的颜色和对齐方式, 我也想增加出现在哪个菜单项上的上下文操作的宽度吗?
谢谢。
<ListView.ItemTemplate>
<DataTemplate>
<customControls:ExtendedViewCell SelectedBackgroundColor="Transparent" >
<ViewCell.ContextActions>
<MenuItem Text="Call" />
<MenuItem Text="Delete" IsDestructive="True" />
</ViewCell.ContextActions>
<ViewCell.View>
<StackLayout HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand" Orientation="Vertical"
Padding="4" Spacing="8">
<Label TextColor="OrangeRed" Text="{Binding Title}" />
<Label TextColor="Blue" Text="{Binding Subtitle} "/>
</StackLayout>
</ViewCell.View>
</customControls:ExtendedViewCell>
</DataTemplate>
</ListView.ItemTemplate>
答案 0 :(得分:0)
更改单元格的内容后,调用ForceUpdateSize() https://docs.microsoft.com/en-us/dotnet/api/Xamarin.Forms.Cell.ForceUpdateSize?view=xamarin-forms