Xamarin形式拓展编程列表视图高度

问题描述:

这是我的XAML: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="SetYourBudget.HomePage"> 
    <StackLayout Orientation="Vertical" VerticalOptions="FillAndExpand"> 
    <Label x:Name="lblImporto" Text="" VerticalOptions="Start" HorizontalOptions="Fill" HorizontalTextAlignment="Center"/> 
    <ListView VerticalOptions="FillAndExpand" x:Name ="list"> 
    </ListView> 
    <StackLayout Orientation="Vertical" Spacing="5" VerticalOptions="EndAndExpand" BackgroundColor="#c1c1c1" x:Name="addLayout" Padding="10"> 
     //I remove thrash code 
    </StackLayout> 
    </StackLayout> 
</ContentPage> 

我动画编程我addLayout向下滚动的StackLayout里面的大小。这是代码,它的工作完美,他可以向下滚动到原来的位置:

private async void BtnDropDown_Tapped(object sender, EventArgs e) 
    { 
     if (isVisible) 
     { 
      // hide 
      // addSection is a section of the addLayout, not relevant in the operation it's only the size i need to scroll 
      await addLayout.TranslateTo(0, addSection.Height + 10); 
      imgDropDown.Source = Device.OnPlatform("btnMostra", "btnMostra", "btnMostra"); 
      isVisible= false; 
     } 
     else 
     { 
      //show 
      await addLayout.TranslateTo(0, 0); 
      imgDropDown.Source = Device.OnPlatform("btnNascondi", "btnNascondi", "btnNascondi"); 
      isVisible= true; 
     } 
    } 

现在,我的问题是:你可以用XAML看,我有ListView命名list这高于布局向下滚动。

当我滚动较低的布局时,我希望列表“增长”以填充由滚动动画释放的大小。

我张贴explicative图像:(OBV我设置一些随机DATAS职高它只是一个文字我的目标是才明白调整)

enter image description here

感谢一切,对不起,我不完美的英语

+0

是哟你能想出这个问题,我有同样的问题。 –

+0

@PrakashChennupati不幸的不是。最后,我们决定采用本地解决方案,而不是使用跨平台。也许[这个链接](https://developer.xamarin.com/guides/xamarin-forms/user-interface/listview/)可能会帮助你,抱歉无法解决这个问题! –

试试这个:

<ListView x:Name="someName"> 
    <ListView.Footer> 
    <Label Text="some text" /> 
    </ListView.Footer> 
</ListView>