Xamarin.Forms:Android的自定义上下文操作

时间:2018-08-04 14:36:31

标签: xamarin xamarin.forms xamarin.android

嗨,我有一个列表视图,在其中添加了ContextActions。

我需要在上下文操作中更改文本大小,菜单项的颜色和对齐方式, 我也想增加出现在哪个菜单项上的上下文操作的宽度吗?

谢谢。

enter image description here

<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>

1 个答案:

答案 0 :(得分:0)