android:自定义滑块上的视觉问题

android:自定义滑块上的视觉问题,android,slider,customization,seekbar,Android,Slider,Customization,Seekbar,我创建了一个工作正常的自定义滑块,但突然它开始显示视觉问题,我不知道该去哪里解决这个问题 问题在于其周围出现黑色边框/渐变。我也在安卓6和安卓4.0.3上进行了测试。两者都表现出同样的问题。在安卓4.0.3上,当我按下工具栏上的动作时,我也可以看到这个问题,它就像一个黑色的渐变阴影 有什么想法吗 我的滑块的代码是: public class StyledSeekBar extends SeekBar { public StyledSeekBar(Context context) { s

我创建了一个工作正常的自定义滑块,但突然它开始显示视觉问题,我不知道该去哪里解决这个问题

问题在于其周围出现黑色边框/渐变。我也在安卓6和安卓4.0.3上进行了测试。两者都表现出同样的问题。在安卓4.0.3上,当我按下工具栏上的动作时,我也可以看到这个问题,它就像一个黑色的渐变阴影

有什么想法吗

我的滑块的代码是:

public class StyledSeekBar extends SeekBar {
public StyledSeekBar(Context context) {
    super(context);
    this.init();
}

public StyledSeekBar(Context context, AttributeSet attrs) {
    super(context, attrs);
    this.init();
}

public StyledSeekBar(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    this.init();
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public StyledSeekBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);
    this.init();
}

/**
 * Initializes the instance of this class.
 */
private void init(){
    setThumb(getResources().getDrawable(R.drawable.apptheme_scrubber_control_selector_holo_light));
    setIndeterminateDrawable(getResources().getDrawable(R.drawable.apptheme_scrubber_progress_horizontal_holo_light));
    setProgressDrawable(getResources().getDrawable(R.drawable.apptheme_scrubber_progress_horizontal_holo_light));
}
}

这不是影子。看起来像.png。试试9png,我找到了解决方案!要解决此类问题,必须验证9-patch图像并解决所有坏补丁。这可以通过使用draw9patch工具来完成。

我想你是对的。我刚刚发现这个网页显示了一些类似的东西。我会在家里试一下。非常感谢。页面在那里: