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職高它只是一個文字我的目標是才明白調整)
感謝一切,對不起,我不完美的英語
是喲你能想出這個問題,我有同樣的問題。 –
@PrakashChennupati不幸的不是。最後,我們決定採用本地解決方案,而不是使用跨平臺。也許[這個鏈接](https://developer.xamarin.com/guides/xamarin-forms/user-interface/listview/)可能會幫助你,抱歉無法解決這個問題! –