问题描述
搜索未进行.所有的搜索栏都变为零,但textView正确显示了值..
Seek is not progressing. All seekbar comes to zero but textView shows value properly..
choosePreset.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View arg0)
{
LayoutInflater inflater = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE));
View customView = inflater.inflate(R.layout.preset_list, null, false);
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setView(customView);
final String[] arr= getEqualizerPresets();
ArrayAdapter<String> namesAA= new ArrayAdapter<String> ( context,R.layout.myitemlist,arr );
ListView list = (ListView) customView.findViewById(R.id.mylist);
list.setAdapter(namesAA);
final AlertDialog ad = builder.create();
list.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView<?> parent, View view, final int position, long id)
{
Toast.makeText(context, "Position"+position, Toast.LENGTH_LONG).show();
//equalizerWrapper.usePreset((short)arr[position]);
for(int v=0;v<eqSeeks.length;v++)
{
// equalizerSeeks(v, eqSeeks[v]);
final int z = v;
eqSeeks[v].post(new Runnable()
{
@Override
public void run()
{
eqSeeks[z].setProgress( EQValues.presetValues[position][z]);
}
});
}
// eqSeeks[2].setProgress(150);
setEqualizerPreset(position);
ad.dismiss();
}
});
ad.show();
}
});
EQValues.presetValues [position] [z]在textView中正确显示,但搜索栏未达到进度.我尝试了很多方法,但是没有任何效果.
EQValues.presetValues[position][z] are showing in textView properly but seekbars are not reaching to the progress . I tried many ways but nothing working.
我尝试使用处理程序,也使用postMethod,如图所示.但是seekBars尚未达到价值.
I tried using handler and also use postMethod as shown. But seekBars not reached to values.
修改
我找到了 answer 来添加 updateThumb
方法为垂直"搜寻栏,但它也不起作用.此问题是由于垂直搜寻栏引起的.
i find a answer to add updateThumb
method to Vertical seekbar but it is also not working. This issue is due to vertical seekbar.
public void updateThumb(){
onSizeChanged(getWidth(), getHeight(), 0, 0);
}
然后在设置进度后调用update thumb方法.
And then call update thumb method after setting progress.
seekBar.setProgress((int) progress);
seekBar.updateThumb();
但这仍然不能解决我的问题
but this still didn't solve my problem
推荐答案
在VerticalSeekbar类中添加updateThumb方法,例如
public void updateThumb()
{
onSizeChanged(getWidth(), getHeight(), 0, 0);
}
然后在设置进度后调用update thumb方法.
seekBar.setProgress((int) progress);
seekBar.updateThumb();
这篇关于垂直Seekbar setProgress无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!