[英]Xamarin Forms Change Frame Height in Runtime
我要制作一個自定義下拉列表,如下所示。
用戶單擊框架后,我需要通過擴大框架高度來進行如下下拉。
<Frame CornerRadius="8" BackgroundColor="{StaticResource LightAirColor}" Padding="10,4,10,4">
<TableView>
<TableSection>
<ViewCell Tapped="OnSortingPaneTapped">
<StackLayout Orientation="Vertical">
<StackLayout Orientation="Horizontal">
<Label Text="Arrange By" TextColor="{StaticResource DarkColor}" FontSize="{DynamicResource FontSize16}"/>
<Label Text="Date/Time" TextColor="{StaticResource NavigationPrimary}" FontSize="{DynamicResource FontSize16}"/>
</StackLayout>
</StackLayout>
</ViewCell>
<ViewCell>
<StackLayout Orientation="Horizontal">
<Label Text="Episode" TextColor="{StaticResource NavigationPrimary}" FontSize="{DynamicResource FontSize16}"/>
</StackLayout>
</ViewCell>
<ViewCell Tapped = "SortJournalByDate">
<StackLayout Orientation="Horizontal" VerticalOptions="Center">
<Label Text="Date/Time" TextColor="{StaticResource NavigationPrimary}" FontSize="{DynamicResource FontSize16}"/>
</StackLayout>
</ViewCell>
</TableSection>
</TableView>
</Frame>
我嘗試使用heightRequest,forceLayout(),但沒有運氣。 當用戶單擊框架時,如何從代碼后面更改高度?
您可以將綁定用於您的身高要求,並在視圖模型中進行更改。
您也可以使用syncfusion組合框達到此目的。
另一件事,如果您無法更改高度,則可以使用可見到不可見的高度
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.