Я изучаю формы ксамарина и до сих пор мне удавалось продвигаться с помощью форума и интернета, но я трахаюсь с проблемой, которую не могу решить.
Таким образом, у меня есть Listview, который показывает сбор данных, и я использую mvvm.
Проблема в том, что при просмотре на мобильном телефоне последний ряд обрезается и кнопки внизу страницы тоже не отображаются.
Я прочитал несколько тем и перепробовал несколько вещей, но ни одна не работает.
PS: я не могу установить фиксированную высоту, она должна быть динамической, в зависимости от размера данных.
Я покажу вам часть кода, чтобы посмотреть, сможете ли вы мне помочь.
Спасибо.
<StackLayout Style = "{StaticResource whiteBody}">
<FlexLayout Direction = "Column" VerticalOptions = "FillAndExpand">
<Grid VerticalOptions = "FillAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height = "Auto" />
<RowDefinition Height = "Auto" />
<RowDefinition Height = "Auto" />
<RowDefinition Height = "Auto" />
<RowDefinition Height = "*" />
</ Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width = "Auto" />
<ColumnDefinition Width = "*" />
</Grid.ColumnDefinitions>
<StackLayout Grid.Column = "0" Grid.Row = "0" Grid.ColumnSpan = "2" Style = "{StaticResource redBar}">
<Label Style = "{StaticResource whiteText}" Text = "OFFER FINDER" HorizontalOptions = "StartAndExpand"
AutomationProperties.IsInAccessibleTree = "True"
AutomationProperties.HelpText = "My offers"
AutomationProperties.Name = "My offers" />
<Label Style = "{StaticResource whiteText}" Text = "MENU" x: Name = "menuLink" HorizontalOptions = "EndAndExpand"
AutomationProperties.IsInAccessibleTree = "True"
AutomationProperties.HelpText = "Back to menu"
AutomationProperties.Name = "Menu">
<! - <Label.GestureRecognizers>
<TapGestureRecognizer Command = "{Binding NavigateCommand}" CommandParameter = "{x: Local Type: MenuView}"
NumberOfTapsRequired = "1" />
</Label.GestureRecognizers> ->
</ Label>
</ StackLayout>
<StackLayout Grid.Column = "0" Grid.Row = "1" Grid.ColumnSpan = "2" Style = "{StaticResource backSave}">
<Label Style = "{StaticResource redText}" Text = "Return" HorizontalOptions = "StartAndExpand"
AutomationProperties.IsInAccessibleTree = "True"
AutomationProperties.HelpText = "Back to the offers search"
AutomationProperties.Name = "Back to search engine" />
<Label Style = "{StaticResource redText}" Text = "Save search" x: Name = "saveSearch" HorizontalOptions = "End"
AutomationProperties.IsInAccessibleTree = "True"
AutomationProperties.HelpText = "Save search"
AutomationProperties.Name = "Save search">
<! - <Label.GestureRecognizers>
<TapGestureRecognizer Command = "{Binding NavigateCommand}" CommandParameter = "{x: Local Type: MenuView}"
NumberOfTapsRequired = "1" />
</Label.GestureRecognizers> ->
</ Label>
</ StackLayout>
<FlexLayout Direction = "Column" Grid.Column = "0" Grid.Row = "2" Grid.ColumnSpan = "2" HeightRequest = "1">
<BoxView Style = "{StaticResource lineHorz}" AutomationProperties.IsInAccessibleTree = "False" />
</ FlexLayout>
<! - Square content ->
<ListView Grid.Column = "0" Grid.Row = "3" Grid.ColumnSpan = "2" HasUnevenRows = "True" ItemsSource = "{Binding DealsList}"
x: Name = "OffersListView" SeparatorVisibility = "Default" HeightRequest = "1000">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Style = "{StaticResource resultStack}" VerticalOptions = "FillAndExpand">
<StackLayout x: Name = "stackFavorites" Style = "{StaticResource favsStack}">
<BoxView BackgroundColor = "Gray" HorizontalOptions = "Start" VerticalOptions = "Center"
HeightRequest = "45" WidthRequest = "45" Margin = "25,0,0,0"
AutomationProperties.IsInAccessibleTree = "False" />
<Label Text = "{Binding stateFav}" VerticalOptions = "Center" Margin = "5"> </ Label>
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Command = "{Binding changeFav}" NumberOfTapsRequired = "1" />
</StackLayout.GestureRecognizers>