【发布时间】:2018-12-12 15:33:55
【问题描述】:
我想制作一个自定义下拉菜单,如下所示。
一旦用户点击了框架,我需要通过扩展框架高度来制作如下下拉菜单。
<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() 但没有成功。当用户单击框架时,如何更改代码后面的高度?
【问题讨论】:
-
在这里找到了解决方案。 stackoverflow.com/questions/49445744/…
标签: c# xaml xamarin xamarin.forms