Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/199.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 5.0.2上的SeekBar渲染错误-我可以修复它吗?_Android - Fatal编程技术网

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

Android 5.0.2上的SeekBar渲染错误-我可以修复它吗?,android,Android,在运行Android 5.0.2的HTC One上,我添加了如下渲染: 点/导引头的实际偏移量是困扰我的。我测试过的Nexus5不是这样的。知道为什么吗 这是XML: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"

在运行Android 5.0.2的HTC One上,我添加了如下渲染:

点/导引头的实际偏移量是困扰我的。我测试过的Nexus5不是这样的。知道为什么吗

这是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"/>
 (...)

(...)

如果您想要更大的点击区域,请从固定高度更改为包裹内容,并使用填充进行补偿:

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


(多亏了微弱的阳光)

试试看,效果不错:)添加底部/顶部填充物可以补偿较小的高度。我认为边距更好,因为这不是SeekBar需要的空间。额外:上次我在Android 6上测试SeekBar的高度比Andorid 5上的要小。你可能想自己测试一下,在安卓6上增加填充。