Android 5.0.2上的SeekBar渲染错误 - 我可以修复吗?

时间:2016-01-09 10:10:08

标签: android

在我的HTC One上运行Android 5.0.2的搜索栏我添加了这样的渲染:

Seekbar with seeker vertically dispositioned

点/导引头的veritcal偏移是困扰我的。在我测试的Nexus 5上并不是这样。知道为什么吗?

这是XML:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    >

    <SeekBar
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:id="@+id/fa_seekBar"
        android:max="167"
        android:progress="@{model.SeekBarValue}"
        android:onStopTrackingTouch="@{model.onStopTracking}"
        android:onProgressChanged="@{model.onValueChanged}"
        android:indeterminate="false"
        android:background="#FBB"/>
 (...)

1 个答案:

答案 0 :(得分:2)

如果您想要更大的点击区域,请从常量高度更改为wrap_content并使用填充进行补偿:

<SeekBar
    android:layout_height="wrap_content"
    android:paddingBottom="10dp"
    android:paddingTop="10dp"
    (...)
/>

(感谢微小的阳光)