react-native-onboarding-swiper icon indicating copy to clipboard operation
react-native-onboarding-swiper copied to clipboard

How to change the position of the image and title? I want title above the Image.

Open shima93 opened this issue 4 years ago • 3 comments

shima93 avatar Dec 10 '20 21:12 shima93

Hey @shima93 did you get around on how to achieve this? I want to do something similar. Thanks!

kkmehta03 avatar May 26 '21 09:05 kkmehta03

Hey @KhyatiMehta3, I actually did a trick to get what I wanted. My way is not 100% the right one. But you can try. As you can see for the title and subtitle I put an empty string and made a block of jsx in the image property. hope it helps you. If you found a better way let me know.

 pages={[
          {
            title: "",
            subtitle: "",
            backgroundColor: Colors.Background,
            image: (
              <SafeAreaView>
                <View>
                  <Text style={styles.headerTop}>WELCOME!</Text>
                </View>
                <View style={styles.imageContainer}>
                  <Image
                    style={{
                      height: "190%",
                      width: isIphoneX() ? "115%" : "100%",
                      resizeMode: "contain",
                    }}
                    source={require("../../assets/onboarding-1.png")}
                  />
                  <TouchableOpacity
                    style={styles.buttonBackground}
                    onPress={() => {  }}
                  >
                    <Text style={styles.button}> GET STARTED</Text>
                  </TouchableOpacity>
                </View>
              </SafeAreaView>
            ),
          },
           ]}

shima93 avatar May 26 '21 17:05 shima93

I just put the same code and add absolute property with some left ,right positions. if there is any better way please let me know.

jotilohana avatar Oct 30 '21 06:10 jotilohana