Android 双拇指测距搜索杆不工作
我在我的应用程序中使用RangeSekBar时引用了这个。我对此有两个问题Android 双拇指测距搜索杆不工作,android,layout,seekbar,Android,Layout,Seekbar,我在我的应用程序中使用RangeSekBar时引用了这个。我对此有两个问题seekbar。我在片段中使用了这个seekbar 1) 我可以在我的仿真器中通过androidAPI19配置看到seekbar。但触控事件并不适用于拇指 2) 在设备中,我根本看不到seekbar。我的设备有安卓4.0.4操作系统 以下是我的布局: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" andro
seekbar
。我在片段中使用了这个seekbar
1) 我可以在我的仿真器中通过androidAPI19
配置看到seekbar
。但触控事件并不适用于拇指
2) 在设备中,我根本看不到seekbar
。我的设备有安卓4.0.4操作系统
以下是我的布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/parentLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<GridView
android:id="@+id/colors_grid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:horizontalSpacing="5dp"
android:numColumns="8"
android:verticalSpacing="5dp" >
</GridView>
<Spinner
android:id="@+id/metricsSpinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/qtyOptionsSpinner" />
<Spinner
android:id="@+id/qtyOptionsSpinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="14dp" />
</RelativeLayout>
请尽快帮助我。这都是因为我的布局结构。我更改了布局结构,将空的相对布局作为父布局的子布局,然后动态地将SeekBar添加到该子相对布局 在更改布局时,我解决了上面发布的两个问题
RangeSeekBar<Integer> seekBar = new RangeSeekBar<Integer>(5,50,this.getActivity());
mParentLayout.addView(seekBar, layoutParams);
seekBar.setOnRangeSeekBarChangeListener(new OnRangeSeekBarChangeListener<Integer>() {
@Override
public void onRangeSeekBarValuesChanged(RangeSeekBar<?> bar, Integer minValue, Integer maxValue) {
// handle changed range values
Log.i("TAG", "User selected new range values: MIN=" + minValue+ ", MAX=" + maxValue);
}
});