2016-04-14 56 views
2

這是我的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/)可能會幫助你,抱歉無法解決這個問題! –

回答

0

試試這個:

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