1010
1111import React from 'react' ;
1212import {
13- SafeAreaView ,
1413 StyleSheet ,
1514 ScrollView ,
1615 View ,
@@ -29,11 +28,24 @@ class App extends React.PureComponent {
2928
3029 Item = ( ) => < View style = { [ styles . item , { backgroundColor : "#" + new Array ( 7 ) . join ( Math . floor ( Math . random ( ) * 10 ) + "" ) } ] } > </ View > ;
3130
31+ IconItem = ( { title } : { title : string } ) => < View style = { {
32+ justifyContent : "center" ,
33+ alignItems : "center" , width : width / 5 ,
34+ } } >
35+ < View style = { {
36+ width : 40 , height : 40 , margin : 4 ,
37+ backgroundColor : "#" + new Array ( 7 ) . join ( Math . floor ( Math . random ( ) * 10 ) + "" ) ,
38+ borderRadius : 20
39+ } } > </ View >
40+ < Text > { title } </ Text >
41+ </ View >
42+
3243 render ( ) {
3344 return (
34- < SafeAreaView >
45+ < View style = { { flex : 1 , backgroundColor : "#eee" } } >
3546 < ScrollView >
3647 < ScrollIndicator
48+ indicatorBgPadding = { 6 }
3749 viewBoxStyle = { {
3850 alignItems : "center" ,
3951 marginTop : 60
@@ -66,6 +78,10 @@ class App extends React.PureComponent {
6678
6779 < ScrollIndicator
6880 indicatorBgPadding = { 6 }
81+ alwaysIndicatorBounce
82+ indicatorBoxStyle = { {
83+ overflow : "visible"
84+ } }
6985 viewBoxStyle = { {
7086 alignItems : "center" ,
7187 marginTop : 60
@@ -79,8 +95,94 @@ class App extends React.PureComponent {
7995 < this . Item />
8096 < this . Item />
8197 </ ScrollIndicator >
98+
99+ < ScrollIndicator
100+ indicatorBoxStyle = { {
101+ overflow : "visible"
102+ } }
103+ viewBoxStyle = { {
104+ alignItems : "center" ,
105+ marginTop : 60 ,
106+ backgroundColor : "#fff" ,
107+ paddingVertical : 20 ,
108+ borderRadius : 10
109+ } } scrollViewBoxStyle = { {
110+ width,
111+ } } indicatorBackgroundStyle = { {
112+ backgroundColor : "#eee" ,
113+ borderRadius : 4 ,
114+ width : 20 ,
115+ height : 4
116+ } } indicatorStyle = { {
117+ backgroundColor : "#007FFF" ,
118+ height : 4 ,
119+ borderRadius : 4 ,
120+ } } >
121+ < View >
122+ < this . IconItem title = { "一个App" } />
123+ < this . IconItem title = { "美食" } />
124+ </ View >
125+ < View >
126+ < this . IconItem title = { "外卖" } />
127+ < this . IconItem title = { "娱乐" } />
128+ </ View >
129+ < View >
130+ < this . IconItem title = { "游戏" } />
131+ < this . IconItem title = { "送药上门" } />
132+ </ View >
133+ < View >
134+ < this . IconItem title = { "打车" } />
135+ < this . IconItem title = { "运动健身" } />
136+ </ View >
137+ < View >
138+ < this . IconItem title = { "学习" } />
139+ < this . IconItem title = { "前端" } />
140+ </ View >
141+ < View >
142+ < this . IconItem title = { "react native" } />
143+ < this . IconItem title = { "教育培训" } />
144+ </ View >
145+ < View >
146+ < this . IconItem title = { "景点/门票" } />
147+ < this . IconItem title = { "买菜" } />
148+ </ View >
149+ < View >
150+ < this . IconItem title = { "不知道干啥" } />
151+ < this . IconItem title = { "Git" } />
152+ </ View >
153+ < View >
154+ < this . IconItem title = { "嗯哼" } />
155+ < this . IconItem title = { "演出" } />
156+ </ View >
157+ < View >
158+ < this . IconItem title = { "生活" } />
159+ < this . IconItem title = { "全部" } />
160+ </ View >
161+ </ ScrollIndicator >
162+
163+
164+ < View style = { {
165+ width,
166+ marginBottom : 400
167+ } } >
168+ < ScrollIndicator
169+ viewBoxStyle = { {
170+ alignItems : "center" ,
171+ marginTop : 60 ,
172+ flex : 1
173+ } } scrollViewBoxStyle = { {
174+ width : undefined
175+ } } >
176+ < this . Item />
177+ < this . Item />
178+ < this . Item />
179+ < this . Item />
180+ < this . Item />
181+ < this . Item />
182+ </ ScrollIndicator >
183+ </ View >
82184 </ ScrollView >
83- </ SafeAreaView >
185+ </ View >
84186 ) ;
85187 }
86188}
0 commit comments