diff --git a/cocos/ui/UISlider.cpp b/cocos/ui/UISlider.cpp index a664425885..039182c1e4 100644 --- a/cocos/ui/UISlider.cpp +++ b/cocos/ui/UISlider.cpp @@ -367,7 +367,7 @@ void Slider::setPercent(int percent) _slidBallRenderer->setPosition(dis, _contentSize.height / 2.0f); if (_scale9Enabled) { - _progressBarRenderer->setPreferredSize(Size(dis,_progressBarTextureSize.height)); + _progressBarRenderer->setPreferredSize(Size(dis,_contentSize.height)); } else {