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

Title and subtitle is not working? #84

Open
bleedweedsuz opened this issue Jul 7, 2020 · 7 comments
Open

Title and subtitle is not working? #84

bleedweedsuz opened this issue Jul 7, 2020 · 7 comments

Comments

@bleedweedsuz
Copy link

bleedweedsuz commented Jul 7, 2020

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?

@jfilter
Copy link
Owner

jfilter commented Jul 7, 2020

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

@bleedweedsuz
Copy link
Author

bleedweedsuz commented Jul 7, 2020

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.

@jfilter
Copy link
Owner

jfilter commented Jul 7, 2020

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

@JanOwiesniak
Copy link

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
Copy link

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

@clemmierose
Copy link

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

@iptelephony
Copy link

iptelephony commented Apr 15, 2022

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.

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

No branches or pull requests

5 participants