How to put background color in xamarin imagecell or how to arrange disproportionate size in ViewCell?

0

follow the code:

<ListView ItemsSource="{Binding Lista}"  SeparatorVisibility="None" ItemSelected="ListView_Selected" HasUnevenRows="True" IsVisible="{Binding Visivel}"
                  >
            <ListView.ItemTemplate>
                <DataTemplate>
                            <ImageCell Text="{Binding Exibir}" ImageSource="{Binding Imagem}" Detail="{Binding Ds_agenda}"></ImageCell>

                </DataTemplate>
            </ListView.ItemTemplate>
</ListView>

But I do not want to put background color, I solved this problem with a ViewCell with the following code

<ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                        <StackLayout Orientation="Horizontal" BackgroundColor="{Binding Cor_fundo}">
                            <Image Source="{Binding Imagem}" />
                            <StackLayout Orientation="Vertical">
                                <Label Text="{Binding Exibir}"
                            TextColor="White" />

                                <Label Text="{Binding Ds_agenda}"
                            TextColor="LightGray"/>
                            </StackLayout>


                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

But the images get disproportionate sizes I wanted a solution to put background color in ImageCell or fix the problem of image size in the ViewCell, I know there is how to customize these Cells but I do not know how. I also tried to see the code behind ImageCell to apply the same in ViewCell but I did not find anything.

    
asked by anonymous 14.02.2018 / 15:53

0 answers