瀏覽代碼

icon image tint color

Artal Druk 8 年之前
父節點
當前提交
553615ae29
共有 1 個檔案被更改,包括 4 行新增2 行删除
  1. 4
    2
      src/RichTextToolbar.js

+ 4
- 2
src/RichTextToolbar.js 查看文件

@@ -31,9 +31,11 @@ export default class RichTextToolbar extends Component {
31 31
     onPressAddLink: PropTypes.func,
32 32
     onPressAddImage: PropTypes.func,
33 33
     selectedButtonStyle: PropTypes.object,
34
+    iconTint: PropTypes.any,
35
+    selectedIconTint: PropTypes.any,
34 36
     unselectedButtonStyle: PropTypes.object,
35 37
     renderAction: PropTypes.func,
36
-    iconMap: PropTypes.object
38
+    iconMap: PropTypes.object,
37 39
   };
38 40
 
39 41
   constructor(props) {
@@ -107,7 +109,7 @@ export default class RichTextToolbar extends Component {
107 109
           ]}
108 110
           onPress={() => this._onPress(action)}
109 111
       >
110
-        {icon ? <Image source={icon}/> : null}
112
+        {icon ? <Image source={icon} style={{tintColor: selected ? this.props.selectedIconTint : this.props.iconTint}}/> : null}
111 113
       </TouchableOpacity>
112 114
     );
113 115
   }