奇妙な問題がありますか?これはXamarinのフォーム(UWP)でのみ発生しています。リストビュー内でリストビューを使用しています。各リストをクリックすると、子リストが表示されます。また、スクロールできるように、子リストの固定高さを設定しました。今すぐチェックすると、黒い色がより多くのアイテムを持っています。どのように私はこれを修正することができます。一覧については残りのスペースに黒い色が入っています。リストビューxamarin-UWP
XAML:
<ListView x:Name="MyProducts"
IsRefreshing="{Binding IsBusy, Mode=TwoWay}"
RefreshCommand="{Binding GetAllProducts,Mode=TwoWay}"
IsPullToRefreshEnabled="true"
HasUnevenRows="True"
BackgroundColor="White"
ItemSelected="CategorySelected"
SeparatorVisibility="None"
ItemsSource="{Binding MyProductsList}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout BackgroundColor="#e6e6e6" Margin="0,2,0,2">
<StackLayout Margin="1" BackgroundColor="White">
<Grid Padding="0,10,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="9*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Text="Product Category" YAlign="Center" Margin="10,0,0,0" Style="{DynamicResource LabelLightStyle}"/>
<Label Grid.Row="1" Grid.Column="0" Text="{Binding Model.ProductCategoryName}" Style="{DynamicResource LabelRedStyle}" YAlign="Center" Margin="10,0,0,0"/>
<Image Grid.Row="0" Grid.Column="1" IsVisible="{Binding IconDown}" Source="ArrowDown.png" HeightRequest="15" Grid.RowSpan="2" Margin="0,0,5,0" HorizontalOptions="End" VerticalOptions="Center"/>
<Image Grid.Row="0" Grid.Column="1" IsVisible="{Binding IconUp}" Source="ArrowUp.png" HeightRequest="15" Grid.RowSpan="2" Margin="0,0,5,0" HorizontalOptions="End" VerticalOptions="Center"/>
<ListView Grid.Row="2" Grid.ColumnSpan="2"
IsVisible="{Binding ListVisibility}"
SeparatorVisibility="Default"
SeparatorColor="#e6e6e6"
ItemSelected="ProductSelected"
HeightRequest="220"
BackgroundColor="#f2f2f2"
HorizontalOptions="FillAndExpand"
ItemsSource="{Binding Model.Products}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout BackgroundColor="#e6e6e6">
<StackLayout Margin="0,0,0,1" BackgroundColor="#f2f2f2">
<Grid Padding="0,10,0,10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="9*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Text="{Binding MachineModel, StringFormat='Machine Model Number : {0}'}" YAlign="Center" Margin="10,0,0,0" Style="{DynamicResource LabelStyle}"/>
<Label Grid.Row="1" Grid.Column="0" Text="{Binding CreatedDate, StringFormat='Date {0}'}" Style="{DynamicResource LabelTinyStyle}" YAlign="Center" Margin="10,0,0,0"/>
<Image Grid.Row="0" Grid.Column="1" Source="ArrowRight.png" HeightRequest="15" Grid.RowSpan="2" Margin="0,0,10,0" HorizontalOptions="End" VerticalOptions="Center"/>
</Grid>
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
XAMLはどこですか?投稿できますか? – AVK
これはIOSとAndroidで正常に動作しています。この問題はUWPでのみ発生しています。使用されているxamlを見つけてください。https://docs.google.com/document/d/1MpbGpZxfu6dsynLGGwJ_eYAHW1pnt37hHFVs1P6MrDM/edit?usp=sharing – Renjith
なぜ、 'BackgroundColor ="#e6e6e6 "'で 'DataTemplate'に2つの' StackLayout'を持っていますか?もう一つは 'BackgroundColor =" White "'? – AVK