私はXamarinフォームのクロスプラットフォームアプリケーションに取り組んでいます。私はリストビューでデータを表示する必要があるフォームを持っています。xamarin形式のリストビューは、フォームのフルスペースを使用していません
データは表示されていますが、スペース全体を使用していないため、下部に不要なスペースが残っています。
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="BMTHomesApp.Views.ImportantAppointments">
<ContentPage.Content>
<StackLayout VerticalOptions="StartAndExpand">
<ListView HasUnevenRows="True" RowHeight="100" HeightRequest="-1" x:Name="ListViewAppointments" VerticalOptions="StartAndExpand">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Padding="20,0,0,0" ColumnSpacing="20">
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!--<BoxView Color="#f7f7f7" Grid.Column="0" Grid.RowSpan="2"/>
<BoxView Color="#ffffff" Grid.Column="1" Grid.RowSpan="2"/>-->
<Image Grid.RowSpan="2" Grid.Column="0" x:Name="ImageAppointmentIcon" Source="AppointmentsIcon.png" Aspect="AspectFit"></Image>
<Label TextColor="#00344e" FontAttributes="Bold" Text="{Binding Subject}" Grid.Row="0" Grid.Column="1" VerticalTextAlignment="End"></Label>
<Label TextColor="#0073ae" Text="{Binding StartDate}" Grid.Row="1" Grid.Column="1" VerticalTextAlignment="Start"></Label>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<ActivityIndicator x:Name="ActLoder" HorizontalOptions="CenterAndExpand" Color="#ffffff" VerticalOptions="CenterAndExpand" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
私は= HeightRequestを設定-1参照してください:あなたは
ActivityIndicator
がListview
と同じスペースに表示したいが、その後、あなたが次のことを試すことができ中心場合ActivityIndicator
の岩下
Listview
を積み重ねていますこれを使用するかどうかはフォームの高さを使用しますが動作しませんでした...また、アクティビティインジケータを削除しても同じ結果を返します – Mahajan344アクティビティインジケータとスタックレイアウトの両方を取り除き、リストビューが全てのページ。また、HasUnevenRows = trueまたはRowHeight = 100のどちらかを設定する必要があります。両方を必要としません。 –
おそらくRowHeight = 100で、行の高さがどのようにハードコードされているかが分かります。 –