Android SeekBar can't be full width even set padding 0 in AppCompat 23.1.0

前端 未结 5 984
天涯浪人
天涯浪人 2020-12-29 20:24

when I update android support lib from 23.0.1 to 23.1.0, I find the SeekBar is not full width any more.

this is the test XML file:



        
5条回答
  •  抹茶落季
    2020-12-29 21:23

    finally, I just have a sudden thought. why not try modify it by java code. It works! following is the sample code:

    protected void initViews(Context context) {
        LayoutInflater.from(context).inflate(getLayoutResId(), this);
        ButterKnife.bind(this);
    
        // set style, just once
        seekBar.setProgress(0);
        seekBar.setMax(0);
    
        seekBar.setPadding(0, 0, 0, 0);
    
        // ...
    }
    

提交回复
热议问题