Is the .Net Maui Listview.Header tag able to contain a label with Text Search and SearchBar control

Ronald Rex 1,666 Reputation points

Hi Friends, I was wondering is the listview header able to be formatted to contain a Label with text Search followed by a SerachBar. These two elements should be on the same line. Thanks !

A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,617 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,981 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 64,576 Reputation points Microsoft Vendor


    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.

              <StackLayout Orientation="Horizontal" BackgroundColor="LightGray">
                  <Label Margin="10,0,0,0" VerticalOptions="CenterAndExpand"
             FontAttributes="Bold" />
              <x:Array Type="{x:Type x:String}">

    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.