I use SeekBar in my app with ticks. Currently this SeekBar is defined in xml file:
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Base.Widget.AppCompat.SeekBar.Discrete"/>
and it looks ok but I want to define this element programmatically so I've added this instead:
SeekBar seekBar = new SeekBar(getContext(), null, R.style.Widget_AppCompat_SeekBar_Discrete);
but then the seekBar is invisible. Does anyone know what's wrong? It's visible if I use only:
SeekBar seekBar = new SeekBar(getContext();
but i need ticks.