我的搜索栏出了什么问题? TAT
What's wrong with my Seekbar? TAT
伙计们,感谢您查看我的问题(TAT)
我在我的设备(小米4,api 23)的videoPlay应用中使用了SeekBar,没问题。
但在其他设备上(Nexus5 api 22,Nexus 6P,api 22),它看起来像这样:
这是我的 xml:
<SeekBar
android:layout_width="match_parent"
android:layout_height="50dp"
style="@style/MediaController_SeekBar"
android:layout_toRightOf="@+id/video_currentTime"
android:id="@+id/video_seekBar"
android:layout_toLeftOf="@+id/video_totalTime"/>
和@style/MediaController_SeekBar:
<style name="MediaController_SeekBar" parent="android:Widget.SeekBar">
<item name="android:progressDrawable">@drawable/scrubber_progress_horizontal_holo_dark</item>
<item name="android:indeterminateDrawable">@drawable/scrubber_progress_horizontal_holo_dark</item>
<item name="android:minHeight">13dip</item>
<item name="android:maxHeight">13dip</item>
<item name="android:thumb">@drawable/scrubber_control_selector_holo</item>
<item name="android:thumbOffset">16dip</item>
<item name="android:paddingLeft">16dip</item>
<item name="android:paddingRight">16dip</item>
</style>
在 api< 23 设备上是错误的
我尝试使用默认样式,但它不起作用
所以,你能帮我吗?非常感谢!
尝试在 Seekbar 上将 minHeight 和 Maxheight 设置为某个值。希望这会有所帮助
android:maxHeight="40dp"
android:minHeight="40dp"
我认为你应该对所有人使用 dp 而不是使用 dip
伙计们,感谢您查看我的问题(TAT)
我在我的设备(小米4,api 23)的videoPlay应用中使用了SeekBar,没问题。 但在其他设备上(Nexus5 api 22,Nexus 6P,api 22),它看起来像这样:
这是我的 xml:
<SeekBar
android:layout_width="match_parent"
android:layout_height="50dp"
style="@style/MediaController_SeekBar"
android:layout_toRightOf="@+id/video_currentTime"
android:id="@+id/video_seekBar"
android:layout_toLeftOf="@+id/video_totalTime"/>
和@style/MediaController_SeekBar:
<style name="MediaController_SeekBar" parent="android:Widget.SeekBar">
<item name="android:progressDrawable">@drawable/scrubber_progress_horizontal_holo_dark</item>
<item name="android:indeterminateDrawable">@drawable/scrubber_progress_horizontal_holo_dark</item>
<item name="android:minHeight">13dip</item>
<item name="android:maxHeight">13dip</item>
<item name="android:thumb">@drawable/scrubber_control_selector_holo</item>
<item name="android:thumbOffset">16dip</item>
<item name="android:paddingLeft">16dip</item>
<item name="android:paddingRight">16dip</item>
</style>
在 api< 23 设备上是错误的
我尝试使用默认样式,但它不起作用
所以,你能帮我吗?非常感谢!
尝试在 Seekbar 上将 minHeight 和 Maxheight 设置为某个值。希望这会有所帮助
android:maxHeight="40dp"
android:minHeight="40dp"
我认为你应该对所有人使用 dp 而不是使用 dip