Oye
Tengo mi barra inferior fuera del componente Vista de desplazamiento, pero todavía se desplaza con los otros componentes. ¿Cómo puedo arreglarlo?
"
<SafeAreaView styles={SafeViewAndroid.AndroidSafeArea}> <View style={{ backgroundColor: "#fff", padding: 15 }}> <HeaderTabs activeTab={activeTab} setActiveTab={setActiveTab} /> <SearchBar cityHandler={setCity} /> </View> <ScrollView showsVerticalScrollIndicator={false}> <Categories /> <RestaurantItems restaurantData={restaurantData} /> </ScrollView> <Divider width={1} /> <BottomTabs /> </SafeAreaView>"
Puede usar proporciones flexibles para separar los componentes y, como se muestra a continuación
<SafeAreaView styles={SafeViewAndroid.AndroidSafeArea}> <View style={{ backgroundColor: "#fff", padding: 15, flex : 1 }}> <HeaderTabs activeTab={activeTab} setActiveTab={setActiveTab} /> <SearchBar cityHandler={setCity} /> </View> <View style= {{flex : 3 }}> <ScrollView showsVerticalScrollIndicator={false}> <Categories /> <RestaurantItems restaurantData={restaurantData} /> </ScrollView> </View> <View style= {{flex : 1 }}> <Divider width={1} /> <BottomTabs /> </View> </SafeAreaView>Puede hacerlo diseñando su componente de botón como -
<TouchableOpacity style={{ width: 60, height: 60, backgroundColor: 'red', position: 'absolute', bottom: 50, justifyContent: 'center', alignItems: 'center', }} onPress={() => { console.log('Button Pressed') }} > <Text>Hello Bottom Button</Text> </TouchableOpacity>