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

Pan isn't working #39

Open
jonatasfernandespimenta opened this issue Jan 21, 2021 · 4 comments
Open

Pan isn't working #39

jonatasfernandespimenta opened this issue Jan 21, 2021 · 4 comments

Comments

@jonatasfernandespimenta

Somehow the pan isn't working for me.

OS: Android
Environment: React Native (without Expo)

Code:

  const renderItem = ({ item }) => (
    <Frame
      width={width}
      source={color[item.uri] || moldura_branca}
      active={activeImage.uri == item.uri}
    >
      <ImageCropper
        imageUri={item.uri}
        cropAreaWidth={width ? activeImage.uri == item.uri ? width / 1.5 : width / 1.6 : 150}
        cropAreaHeight={width ? activeImage.uri == item.uri ? width / 1.5 : width / 1.6 : 150}
        setCropperParams={setCropperParams}
      />
    </Frame>
  )
  .
  .
  .
          <FlatList
            horizontal
            showsHorizontalScrollIndicator={false}
            extraData={EXTRA}
            data={DATA}
            scrollEnabled={false}
            renderItem={renderItem}
            keyExtractor={item => item.uri}
            onViewableItemsChanged={viewableChangeHandler.current}
            viewabilityConfig={{ itemVisiblePercentThreshold: 60 }}
            ref={flatListRef}
          />

Code for Frame:

export const Frame = styled.ImageBackground`
  height: ${({width, active}) => (width ? active ? width / 1.2 : width / 1.3 : 50)}; 
  width: ${({width, active}) => (width ? active ? width / 1.2 : width / 1.3 : 50)}; 
  justify-content: center; 
  align-items: center;
  align-self: center;
`;
@jonatasfernandespimenta
Copy link
Author

Resolved by installing version 1.1.2, but I really would like this working in the latest version

@khuongtp
Copy link

Resolved by installing version 1.1.2, but I really would like this working in the latest version

Hi, I got same problem and installed v 1.1.2 but when I press crop image it show this [Invariant Violation: ImageEditor has been removed from React Native. It can now be installed and imported from '@react-native-community/image-editor' instead of 'react-native'. See https://github.com/react-native-community/react-native-image-editor]. Did you have to install @react-native-community/image-editor or something

@jonatasfernandespimenta
Copy link
Author

When I the problem from the issue, I didn't have this problem, but, I think you'll have to dive into this lib folder, look for this ImageEditor and replace this line with the ImageEditor from the RN Community.

@khuongtp
Copy link

@jonatasfernandespimenta Thanks for replying. I installed version 2.0.2 and it's working now.

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

No branches or pull requests

2 participants