Просмотр исходного кода

Cambie los botones del screen y le puse un ScrollView component para que funcione en el celular

ErnestoOrtiz2 3 лет назад
Родитель
Сommit
990f879c41
1 измененных файлов: 5 добавлений и 3 удалений
  1. 5
    3
      screens/main/Search.js

+ 5
- 3
screens/main/Search.js Просмотреть файл

1
 import React, { useState } from 'react'
1
 import React, { useState } from 'react'
2
-import { Text, View,  StyleSheet, FlatList, TouchableOpacity } from 'react-native'
2
+import { Text, View,  StyleSheet, FlatList, TouchableOpacity, Button, ScrollView } from 'react-native'
3
 import SelectBox from 'react-native-multi-selectbox'
3
 import SelectBox from 'react-native-multi-selectbox'
4
 import { xorBy } from 'lodash'
4
 import { xorBy } from 'lodash'
5
 import firebase from 'firebase'
5
 import firebase from 'firebase'
172
 
172
 
173
 
173
 
174
   return (
174
   return (
175
+    <ScrollView>
175
     <View style={{ margin: 30 }}>
176
     <View style={{ margin: 30 }}>
176
       <View style={{ width: '100%', alignItems: 'center' }}>
177
       <View style={{ width: '100%', alignItems: 'center' }}>
177
         <Text style={{ fontSize: 30, paddingBottom: 20 }}>Busqueda</Text>
178
         <Text style={{ fontSize: 30, paddingBottom: 20 }}>Busqueda</Text>
228
       />
229
       />
229
 
230
 
230
       {/* button that will fetch the users */}
231
       {/* button that will fetch the users */}
231
-      <button onClick={() => fetchUsers(selectedTags, selectedDays)}>Buscar</button>
232
+      <Button title='Buscar' onPress={() => fetchUsers(selectedTags, selectedDays)}/>
232
 
233
 
233
 
234
 
234
       <FlatList
235
       <FlatList
242
             <View style={{ flexDirection: "row", paddingBottom: 20, paddingTop: 20,  justifyContent: "space-between" }}>
243
             <View style={{ flexDirection: "row", paddingBottom: 20, paddingTop: 20,  justifyContent: "space-between" }}>
243
               <Text>{item.data.name}</Text>
244
               <Text>{item.data.name}</Text>
244
               <Text>{item.data.Precio}</Text>
245
               <Text>{item.data.Precio}</Text>
245
-              <button  styles = {styles.button}     onClick={() => { dothing(item.id) }}>Button</button>
246
+              <Button title='Buscar' onPress={() => { dothing(item.id) }}/>
246
             </View>
247
             </View>
247
             <View style={{ borderBottomColor: 'black', borderBottomWidth: 1 }} />
248
             <View style={{ borderBottomColor: 'black', borderBottomWidth: 1 }} />
248
           </View>
249
           </View>
251
         />
252
         />
252
 
253
 
253
     </View>
254
     </View>
255
+    </ScrollView>
254
   );
256
   );
255
 
257
 
256
   function onMultiChange() {
258
   function onMultiChange() {