I have not been able to organize my layout in my ListView, it is disorganized, I tried to use several forms but so far nothing, I would like to have tips / help. I wish I could have Código
at the beginning, Valor
in the middle, and Hora lance
at the end. No Genymotion:
OnanAndroiddevice:
Note:IamavoidingStackLayout
becauseIhaveunderstoodfromsomesourcesthatitcandisrupttheuser'sfinalperformance.
FollowXAMLcode:
<!--ListagemdeLances--><StackLayout><ListViewx:Name="lstLance"
ItemTapped="Lance_OnItemTapped"
BackgroundColor="LightGray"
HasUnevenRows="True">
<!-- HasUnevenRows = Serve para fazer com que o conteúdo digitado não seja cortado -->
<ListView.ItemTemplate>
<!-- DataTemplate = exibe dados de uma coleção de objetos em um ListView -->
<DataTemplate>
<ViewCell>
<Grid Margin="2">
<!-- Colunas -->
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Linhas -->
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1"/>
</Grid.RowDefinitions>
<!-- Código -->
<Label Grid.Row="0"
Grid.Column="0"
Text="Código:"
FontSize="Small"
Margin="0"/>
<Label Grid.Row="0"
Grid.Column="1"
Text="{Binding ID_LANCE}"
FontSize="Small"
TextColor="Black"
HorizontalOptions="Start"
Margin="0"/>
<!-- Valor -->
<Label Grid.Row="0"
Grid.Column="2"
Text="Valor:"
FontSize="Small"
Margin="0"
HorizontalOptions="Center"/>
<Label Grid.Row="0"
Grid.Column="3"
Text="{Binding VALOR}"
FontSize="Small"
TextColor="Black"
HorizontalOptions="Start"
Margin="0"/>
<!-- Hora do Lance -->
<Label Grid.Row="0"
Grid.Column="4"
Text="Hora lance:"
FontSize="Small"
HorizontalOptions="End"
Margin="0"/>
<Label Grid.Row="0"
Grid.Column="5"
Text="{Binding HR_LANCE}"
FontSize="Small"
TextColor="Black"
HorizontalOptions="End"
Margin="0"/>
<!-- Repartir conteudo com cor -->
<BoxView Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="6"
BackgroundColor="Red"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>