在我的HTC One上运行Android 5.0.2的搜索栏我添加了这样的渲染:
点/导引头的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"/>
(...)
答案 0 :(得分:2)
如果您想要更大的点击区域,请从常量高度更改为wrap_content并使用填充进行补偿:
<SeekBar
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:paddingTop="10dp"
(...)
/>
(感谢微小的阳光)