[C#/MAUI/.NET6] ListView 엘리먼트 : IsFastScrollEnabled 첨부 속성을 사용해 빠른 스크롤 설정하기 (ANDROID)
C#/MAUI 2022. 6. 9. 13:31728x90
반응형
728x170
▶ MainPage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="TestProject.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:android="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls"
xmlns:local="clr-namespace:TestProject">
<ContentPage.Resources>
<local:ImageSourceConverter x:Key="ImageSourceConverterKey" />
</ContentPage.Resources>
<ListView x:Name="listView"
RowHeight="70"
SeparatorVisibility="None"
android:ListView.IsFastScrollEnabled="true">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid
VerticalOptions="Center"
Padding="5"
RowDefinitions="Auto"
ColumnDefinitions="Auto,10,*">
<Image Grid.Column="0"
WidthRequest="60"
HeightRequest="60"
Aspect="AspectFill"
Source="{Binding ImageURL, Converter={StaticResource ImageSourceConverterKey}}" />
<StackLayout Grid.Column="2">
<Label
FontAttributes="Bold"
FontSize="16"
Text="{Binding Name}" />
<Label
VerticalOptions="End"
FontAttributes="Italic"
Text="{Binding Location}" />
</StackLayout>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
728x90
반응형
그리드형(광고전용)
댓글을 달아 주세요