android – Vertical Seekbar setProgress不工作

寻求没有进展.所有搜索栏都归零,但textView正确显示值.

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中正确显示但是搜索栏没有达到进度.我尝试了很多方法但没有任何效果.

我尝试使用处理程序,并使用postMethod,如图所示.但是,seekBars没有达到价值观.

编辑

我发现answer将updateThumb方法添加到Vertical seekbar但它也无法正常工作.此问题是由垂直搜索栏引起的.

public void updateThumb(){
     onSizeChanged(getWidth(), getHeight(), 0, 0);
}

然后在设置进度后调用update thumb方法.

seekBar.setProgress((int) progress);
seekBar.updateThumb();

但这仍然没有解决我的问题

解决方法:

I am facing some other problem. but the given statement works.

在VerticalSeekbar类中添加updateThumb方法

public void updateThumb()
{
     onSizeChanged(getWidth(), getHeight(), 0, 0);
}

然后在设置进度后调用update thumb方法.

seekBar.setProgress((int) progress);
seekBar.updateThumb();
上一篇:前端jsdebug调试


下一篇:element progress源码