Slider vs SeekBar on Xamarin.Android in Visual Studio 2022

Nathan Sokalski 4,126 Reputation points
2024-09-28T15:41:07.3533333+00:00

I am working on adding a Slider or SeekBar to a Xamarin.Android app. There are 2 scenarios in which I will be using this. The first one is just a simple standard select a value from x to y scenario. The second scenario is more unique, although I have seen it used (whether it was designed using a Slider, SeekBar or maybe something else altogether). It is what I would call an "Infinite Slider", which is a slider that allows the user to select any value from -infinity to +infinity by sliding the background rather than the thumb, so the thumb would always be in the center of the slider. I don't know if there is a View/control with this functionality built in or whether I would have make a custom View (possibly by inheriting from Slider or SeekBar), although it would require overriding so many properties & events that it might sometimes be better to just completely design it myself. But here are some of my main questions:

  1. Is SeekBar or com.google.android.material.slider.Slider usually better? SeekBar shows up better in the Designer while the Slider does not, but maybe that is just something I need to change.
  2. Do either of these have the "Infinite Slider" capability I mention above?
  3. Are there any significant differences that would affect the general usage?

Any help would be appreciated, thanks!

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,346 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,823 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,080 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.