Skip to content

feat: Add support for images #101

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

Merged

Conversation

andresain123
Copy link
Contributor

Overview

This Pull Request adds support for images inside segmented controls.

An example of how it works:
<SegmentedControl values={['One', 'Two', require('../assets/images/user.png')]} />

Fixes: #71

Test Plan

The example app is updated with this new functionality

Some previews:
Simulator Screen Shot - iPhone 11 - 2020-06-22 at 02 20 14
Screenshot_20200622-022201

Copy link
Member

@Naturalclar Naturalclar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andresain123 Awesome! Thank you so much!

@Naturalclar Naturalclar merged commit f09b54e into react-native-segmented-control:master Jul 4, 2020
@sergey-king
Copy link

Any plans to add Expo support for images? @andresain123 @Naturalclar

@yingtao-futurewonder
Copy link

I need @expo/vector-icons support too! @andresain123 @Naturalclar

@andresain123
Copy link
Contributor Author

@sergey-king to be honest I don't know how Expo handles the native libraries, but I think they have to update their internal version of the segmented control to 2.1.0+ in order for you to have support on the new features.

@yingtao-futurewonder I'll see what I can do to support individual react components on the segmented control values.

@NikolozCh
Copy link

Hey, thanks for this feature! @andresain123

Looks like it must be problematic with modern version of iOS?

image

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

Successfully merging this pull request may close these issues.

Support for icons?
6 participants