亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

XAML 中的 Xamarin.Forms ListView 自動高度

XAML 中的 Xamarin.Forms ListView 自動高度

C#
慕絲7291255 2022-12-24 09:57:26
我有帶 ViewCell 的 ListView,它的 ViewCell 包含帶有大文本的標簽。如何制作自動高度的 ViewCell???我的 XAML 代碼:    <ContentPage  xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Physis.Movements_And_Interactions_Page" xmlns:local="clr-namespace:Physis">    <ContentPage.ToolbarItems>     <ToolbarItem  x:Name="settings" Text="{Binding settings_text}" Clicked="Handle_Clicked"/>    </ContentPage.ToolbarItems>    <ContentPage.Content>     <StackLayout Margin="20,35,20,20" x:Name="Main_View2" >            <ListView x:Name="Main_Menu" ItemsSource="{Binding Planets}" ItemSelected="Handle_ItemSelected" ItemTapped="Handle_ItemTapped" BackgroundColor="{DynamicResource Key=backgroundColor}" SeparatorColor="{DynamicResource Key=textColor}">            <ListView.ItemTemplate>            <DataTemplate >             <ViewCell >              <StackLayout Orientation="Vertical" >               <Label Text="{Binding Name}" StyleClass="Body"/>               <Label Text="{Binding Description}" StyleClass="Body"/>                            </StackLayout>             </ViewCell>            </DataTemplate>             </ListView.ItemTemplate>              </ListView>      </StackLayout ></ContentPage.Content>感謝大家!
查看完整描述

1 回答

?
尚方寶劍之說

TA貢獻1788條經驗 獲得超4個贊

HasUnevenRows="true"在您的 ListView 上設置。請參閱此處的文檔https://learn.microsoft.com/en-us/dotnet/api/Xamarin.Forms.ListView.HasUnevenRows?view=xamarin-forms


查看完整回答
反對 回復 2022-12-24
  • 1 回答
  • 0 關注
  • 145 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號