react-native-image-carousell icon indicating copy to clipboard operation
react-native-image-carousell copied to clipboard

allign selected image centrally

Open vishalpachpande opened this issue 8 years ago • 1 comments

0 down vote

I have integrated "react-native-image-carousell" (horizontal user list), in this I am trying to show selected user in center but as I select user its start shifting selected user towards right side and for this I have used bellow code.

const layoutWidth = event.layoutMeasurement.width;
const currentIndex = Math.floor((event.contentOffset.x + (0.5 *layoutWidth)) / layoutWidth); const newPreviewOffset = (((currentIndex - 2) * this.props.previewImageSize) + this._bias)+50;
if (this._previewOffset !== newPreviewOffset && currentIndex > 1) { this._refPreviewListView.scrollTo({ x: newPreviewOffset });
this._previewOffset = newPreviewOffset;
}

vishalpachpande avatar Mar 17 '17 07:03 vishalpachpande

I cannot reproduce your case and Example works as expect. How about to provide some demo in sketch.expo.io? Maybe you have some cases which are not covered in my original design.

Kudo avatar Mar 24 '17 17:03 Kudo