Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

226
Visualizações
React-Native: Custom floating scrollbar over normal ScrollView

I want to have a floating custom scrollbar over a normal scrollbar, I have no idea how I can translate current scroll position so that it's reflected on my custom floating scrollbar, which has two components, background and the moving thumb thing!

//import * as React from 'react';
import { View, Animated, ScrollView } from 'react-native';
import React, { useState, useEffect,useRef } from 'react'


export default CustomScrollBarOverNormalScrollBar = (props) => 
{
    const onScroll = () =>
    {
        console.log('User scrolled');
    };

    return(
    <View style={{flex:1}}>
        <ScrollView showsVerticalScrollIndicator={false} scrollEventThrottle={16} style={{flex:1,backgroundColor:'white',position:'relative'}} 
            onScroll={onScroll}>
                <View style={{ width:'100%', height:700, backgroundColor:'rgb(235,235,235)' }}></View>
        </ScrollView>
        <View style={{width:'100%',height:100,position:'absolute',bottom:0,left:0}}>
            {/*CUSTOM SCROLLBAR COMPONENT START*/}
            <View style={{ width:20,height:100,borderRadius:25,backgroundColor:'rgb(235,235,235)',overflow:'hidden',position:'absolute',right:0,top:0 }}>
                <View style={{ width:'100%',height:30,backgroundColor:'red',borderRadius:25 }}></View>   
            </View>
            {/*CUSTOM SCROLLBAR COMPONENT END*/}
        </View>
    </View>
    );    
};
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda