Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Not able to add view behind the dots #82

Open
ShivamJoker opened this issue Mar 31, 2022 · 2 comments
Open

[question] Not able to add view behind the dots #82

ShivamJoker opened this issue Mar 31, 2022 · 2 comments
Labels

Comments

@ShivamJoker
Copy link

💬 Question

Is there any way I can add my custom view or element behind the dots, I tried using zIndex and elevation it didn't work.

I would be thankful if you could help

@ShivamJoker ShivamJoker added the Question ❓ Question label Mar 31, 2022
@kristerkari
Copy link
Owner

@ShivamJoker could you please provide some kind of code example of what you are doing exactly?

@ShivamJoker
Copy link
Author

ShivamJoker commented Apr 8, 2022

Sure here it is

const Onboarding = ({navigation}: Props) => {
  return (
    <ScrollView>
      <Carousel
        mergeStyles={true}
        containerStyle={{height: 500}}
        showsControls={false}
        dotsContainerStyle={{elevation: 100}}
        dotStyle={{
          backgroundColor: Color.RED_300,
          position: 'relative',
          elevation: 100,
        }}
        activeDotStyle={{backgroundColor: Color.RED_500}}
      >
        {imageList.map((img, idx) => (
          <FastImage
            style={style.coverImg}
            key={idx}
            source={img}
            resizeMode="cover"
          />
        ))}
      </Carousel>
      <LinearGradient
        style={style.gradient}
        colors={['#19194000', '#181727']}
      />
      <View style={style.footer}>
        <PrimaryButton
          onPress={() => navigation.push('Main')}
          label="Continue with email"
        />
        <BaseText text="Or signin up with" mv={24} />
        <Link style={{flexDirection: 'row'}} to="/Sign In">
          <BaseText variant="sm" text="Already have an account? " />
          <BaseText text="Sign in" />
        </Link>
      </View>
    </ScrollView>
  );
};

export default Onboarding;

const style = StyleSheet.create({
  footer: {
    margin: 24,
    alignItems: 'center',
  },
  coverImg: {
    width: '100%',
    height: 500,
    position: 'absolute',
    zIndex: -10,
  },
  gradient: {
    width: '100%',
    height: 160,
    position: 'absolute',
    top: 500 - 160,
    elevation: 0,
  },
});

I want the dots to come above the gradient I made
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants