Hello,
Is there a way to change background color for them
Yes.
- For
Searchbar
, please open theResources\Styles\Styles.xaml
file, then find the<Style TargetType="SearchBar">
tag, change the value of<Setter Property="BackgroundColor" Value="Green" />
, I set the green for testing.
====================Update======================
- For
Stepper
, you can change the background color byHandler
. Change the Button's background color bylinearLayout.GetChildAt(0).SetBackgroundColor(Android.Graphics.Color.Red);
.
Microsoft.Maui.Handlers.StepperHandler.Mapper.AppendToMapping("MyCustomization", (handler, view) =>
{
#if ANDROID
Android.Widget.LinearLayout linearLayout= handler.PlatformView as Android.Widget.LinearLayout;
linearLayout.GetChildAt(0).SetBackgroundColor(Android.Graphics.Color.Red);
linearLayout.GetChildAt(1).SetBackgroundColor(Android.Graphics.Color.Red);
#endif
});
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.