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

Title and subtitle is not working?

Open bleedweedsuz opened this issue 4 years ago • 7 comments

title and subtitle is working only when image is not added or set it null other wise with image it will display nothing. i will only set padding or some space for title and subtitle.

i try to override titleStyle it's not working?

bleedweedsuz avatar Jul 07 '20 07:07 bleedweedsuz

Hey, I don't understand what you try to achieve. Do you only want to use images (and not title / subtitle)?

jfilter avatar Jul 07 '20 11:07 jfilter

I m saying while using image, title and subtitle is not visible. U can see in the image.

And yes i want to use both image and text.

bleedweedsuz avatar Jul 07 '20 11:07 bleedweedsuz

I'mt not sure if the outer view with flexbox is needed. Did you take a lot at the examples? Generally, the component is working. https://github.com/jfilter/react-native-onboarding-swiper/blob/master/examples/Simple.js

jfilter avatar Jul 07 '20 11:07 jfilter

Same issue here. This displays only the image (no title, no subtitle)

const OnboardingScreen = (props) => {
  return (
    <Onboarding
      showSkip={false}
      onDone={() => Navigation.setRoot(mainRoot)}
      pages={[
        {
          backgroundColor: '#ffffff',
          image: <Image style={styles.image} source={require('./assets/img/logo.png')} />,
          title: 'Title 1',
          subtitle: 'Subtitle 1',
        },
        {
          backgroundColor: '#bcdcd2',
          image: <Image style={styles.image} source={require('./assets/img/logo.png')} />,
          title: 'Title 2',
          subtitle: 'Subtitle 2',
        },
        {
          backgroundColor: '#f1e8d1',
          image: <Image style={styles.image} source={require('./assets/img/logo.png')} />,
          title: 'Title 3',
          subtitle: 'Subtitle 3',
        },
      ]}
    />
  )
}

const styles = StyleSheet.create({
  image: {
    width: "50%",
    resizeMode: "contain"
  }
});

While this shows title and subtitle

const OnboardingScreen = (props) => {
  return (
    <Onboarding
      showSkip={false}
      onDone={() => Navigation.setRoot(mainRoot)}
      pages={[
        {
          backgroundColor: '#ffffff',
          title: 'Title 1',
          subtitle: 'Subtitle 1',
        },
        {
          backgroundColor: '#bcdcd2',
          title: 'Title 2',
          subtitle: 'Subtitle 2',
        },
        {
          backgroundColor: '#f1e8d1',
          title: 'Title 3',
          subtitle: 'Subtitle 3',
        },
      ]}
    />
  )
}

const styles = StyleSheet.create({
  image: {
    width: "50%",
    resizeMode: "contain"
  }
});

Wrapped component in a View with flex 1 already. Did not solve the issue.

JanOwiesniak avatar Feb 17 '21 16:02 JanOwiesniak

Seems to be related to the image pixel size. Not working: 5520×1320 Working: 250x250

JanOwiesniak avatar Feb 17 '21 16:02 JanOwiesniak

I have the same issue, resizing the image doesn't help. Anyone managed to resolve the issue?

clemmierose avatar Jun 04 '21 09:06 clemmierose

Realise I'm a little late to the party, but hope this helps someone else. I noticed that if I specify the height for Image, the title and subtitles are displayed. If I just specify the width alone, nothing shows. Specifying both width, and height it shows.

iptelephony avatar Apr 15 '22 06:04 iptelephony