diff --git a/cocos/ui/UIEditBox/UIEditBox.cpp b/cocos/ui/UIEditBox/UIEditBox.cpp index 27e4ccc95b..6ef69b9e74 100644 --- a/cocos/ui/UIEditBox/UIEditBox.cpp +++ b/cocos/ui/UIEditBox/UIEditBox.cpp @@ -268,7 +268,7 @@ void EditBox::setPlaceholderFontSize(int fontSize) _placeholderFontSize = fontSize; if (_editBoxImpl != nullptr && _placeholderFontName.length() > 0) { - _editBoxImpl->setPlaceholderFont(_placeholderFontName.c_str(), _fontSize); + _editBoxImpl->setPlaceholderFont(_placeholderFontName.c_str(), fontSize); } } diff --git a/cocos/ui/UIEditBox/UIEditBoxImplIOS.mm b/cocos/ui/UIEditBox/UIEditBoxImplIOS.mm index d78dd0c765..a2456ed125 100644 --- a/cocos/ui/UIEditBox/UIEditBoxImplIOS.mm +++ b/cocos/ui/UIEditBox/UIEditBoxImplIOS.mm @@ -395,8 +395,6 @@ void EditBoxImplIOS::setFont(const char* pFontName, int fontSize) _label->setSystemFontName(pFontName); _label->setSystemFontSize(fontSize); - _labelPlaceHolder->setSystemFontName(pFontName); - _labelPlaceHolder->setSystemFontSize(fontSize); } void EditBoxImplIOS::setFontColor(const Color3B& color) @@ -407,7 +405,8 @@ void EditBoxImplIOS::setFontColor(const Color3B& color) void EditBoxImplIOS::setPlaceholderFont(const char* pFontName, int fontSize) { - // TODO: need to be implemented. + _labelPlaceHolder->setSystemFontName(pFontName); + _labelPlaceHolder->setSystemFontSize(fontSize); } void EditBoxImplIOS::setPlaceholderFontColor(const Color3B& color)