Hello,
Yes, Header
of type object
, specifies the string or view that will be displayed at the start of the list. You can put Label and SearchBar in the Listview.Header
's Stacklayout like following code.
<ListView>
<ListView.Header>
<StackLayout Orientation="Horizontal" BackgroundColor="LightGray">
<Label Margin="10,0,0,0" VerticalOptions="CenterAndExpand"
Text="Search"
FontSize="12"
FontAttributes="Bold" />
<SearchBar/>
</StackLayout>
</ListView.Header>
<ListView.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>mono</x:String>
<x:String>monodroid</x:String>
</x:Array>
</ListView.ItemsSource>
</ListView>
For more information, you can refer to this document: Display views in the header and footer
Best Regards, Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.