@@ -68,6 +68,64 @@ const NoticeBarExample = () => {
6868export default NoticeBarExample;
6969```
7070
71+ ### 设置图标
72+
73+ ```jsx mdx:preview
74+ import React from ' react' ;
75+ import { Image,View,Text } from ' react- native'
76+ import NoticeBar from ' @uiw/ react- native/ lib/ NoticeBar' ;
77+ import Spacing from ' @uiw/ react- native/ lib/ Spacing' ;
78+ import Icon from ' @uiw/ react- native/ lib/ Icon' ;
79+
80+ const NoticeBarExample = () => {
81+ return (
82+ <View style={{ marginTop: 10 }}>
83+ <NoticeBar mode="link" icon={<Icon name="apple" size={15} />} onPress={() => console.log(' link' )}>
84+ : 春节放假时间为30天,请务必关好门窗,断开所有电源!
85+ </NoticeBar>
86+ <Spacing />
87+ <NoticeBar mode="link" icon={<Icon name="alipay" size={15} />} onPress={() => console.log(' link' )}>
88+ : 即今日2月20日开始,停水40天!请知悉。
89+ </NoticeBar>
90+ <Spacing />
91+ <NoticeBar mode="link" icon={<Icon name="baidu" size={15} />} onPress={() => console.log(' link' )}>
92+ : 告诉大家一个‘幸福’的好消息,我们退休将延迟至65岁!!
93+ </NoticeBar>
94+ </View>
95+ )
96+ }
97+ export default NoticeBarExample;
98+ ```
99+
100+ ### 设置通告栏样式和文字样式
101+
102+ ```jsx mdx:preview
103+ import React from ' react' ;
104+ import { Image,View,Text } from ' react- native'
105+ import NoticeBar from ' @uiw/ react- native/ lib/ NoticeBar' ;
106+ import Spacing from ' @uiw/ react- native/ lib/ Spacing' ;
107+ import Icon from ' @uiw/ react- native/ lib/ Icon' ;
108+
109+ const NoticeBarExample = () => {
110+ return (
111+ <View style={{ marginTop: 10 }}>
112+ <NoticeBar mode="link" style={{backgroundColor:' #fff' }} textStyle={{color:' orange' }} onPress={() => console.log(' link' )}>
113+ 通知: 春节放假时间为30天!
114+ </NoticeBar>
115+ <Spacing />
116+ <NoticeBar mode="link" style={{backgroundColor:' orange' }} textStyle={{color:' #fff' }} onPress={() => console.log(' link' )}>
117+ : 告诉大家一个‘幸福’的好消息,我们退休将延迟至65岁!!
118+ </NoticeBar>
119+ <Spacing />
120+ <NoticeBar mode="link" style={{backgroundColor:' #fff' }} textStyle={{color:' blue' }} onPress={() => console.log(' link' )}>
121+ : 告诉大家一个‘幸福’的好消息,我们退休将延迟至65岁!!
122+ </NoticeBar>
123+ </View>
124+ )
125+ }
126+ export default NoticeBarExample;
127+ ```
128+
71129### Props
72130
73131属性 | 说明 | 类型 | 默认值
0 commit comments