From b57ab464f25f4c43bfb2ca1ae36f1fd14b453b54 Mon Sep 17 00:00:00 2001 From: Knox Date: Mon, 11 Jun 2018 17:41:24 +0800 Subject: [PATCH] add update PlaceholderText for EditBoxImpl (#2843) --- cocos2d/core/components/editbox/CCEditBox.js | 2 ++ cocos2d/core/components/editbox/CCEditBoxImpl.js | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/cocos2d/core/components/editbox/CCEditBox.js b/cocos2d/core/components/editbox/CCEditBox.js index 473e80dc1a..aaf4317def 100644 --- a/cocos2d/core/components/editbox/CCEditBox.js +++ b/cocos2d/core/components/editbox/CCEditBox.js @@ -198,6 +198,7 @@ let EditBox = cc.Class({ default: 'Enter text here...', notify () { this._placeholderLabel.string = this.placeholder; + this._impl.setPlaceholderText(this.placeholder); } }, @@ -339,6 +340,7 @@ let EditBox = cc.Class({ impl.setTabIndex(this.tabIndex); impl.setFontColor(this.fontColor); impl.setFontSize(this.fontSize); + impl.setPlaceholderText(this.placeholder); impl.setDelegate(this); diff --git a/cocos2d/core/components/editbox/CCEditBoxImpl.js b/cocos2d/core/components/editbox/CCEditBoxImpl.js index 85ee31bc57..3fb18265e3 100644 --- a/cocos2d/core/components/editbox/CCEditBoxImpl.js +++ b/cocos2d/core/components/editbox/CCEditBoxImpl.js @@ -146,6 +146,14 @@ let EditBoxImpl = cc.Class({ return this._text; }, + setPlaceholderText (text) { + this._placeholderText = text; + }, + + getPlaceholderText () { + return this._placeholderText; + }, + setDelegate (delegate) { this._delegate = delegate; },