Hello,
For Android, you could customize the scrollbar and keep it visible all the time in the following ways:
Step 1. Create a singleton of MainActivity
in MainActivity.cs
public class MainActivity : MauiAppCompatActivity {
public static MainActivity Instance { get; private set; }
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
Instance = this;
}
}
Step 2. Add a custom scrollbar and keep it visible.
protected override void OnHandlerChanged()
{
base.OnHandlerChanged();
#if ANDROID
var view = test_coll.Handler.PlatformView as Android.Views.View; // test_coll is the name of collectionview
view.VerticalScrollBarEnabled = true;
view.ScrollBarStyle = Android.Views.ScrollbarStyles.InsideOverlay;
// You c use your own scrollbars by putting your own custom scrollbar styles into `Platforms/Android/Resources/Drawable` folder.
view.VerticalScrollbarThumbDrawable = AppCompatResources.GetDrawable(MainActivity.Instance, Resource.Drawable.btn_checkbox_checked_mtrl);
view.ScrollbarFadingEnabled = false;
#endif
}
For iOS, the scroll view only shows the scroll bar when scrolling, which is not customizable due to Apple's limitations.
Best Regards,
Alec Liu.
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.