I am trying to create a selector in react native using PANRESPONDER in reactNative. Actually width of a View is oriented from left to right, and Height of the View is oriented from top to bottom. I want to dynamically reverse the box. So I am giving width and height as a negative Value. But the View disappears. How could I reverse the View ?
Asked
Active
Viewed 1,215 times
0
-
I suggest you edit the question with a bit more information. It's not clear what your are trying to achieve, so it's difficult to help. – jevakallio Jan 27 '17 at 15:16
-
possible duplicate http://stackoverflow.com/questions/30203154/get-size-of-a-view-in-react-native – Pramendra Gupta Jan 28 '17 at 02:53
1 Answers
1
If anybody ends up here looking for how to make a value negative of say the screen dimensions so you can move an element around in say a slider..
let screenWidth = Dimensions.get('window').width;
let screenWidthNegative = parseInt('-' + screenWidth);
<View style={[styles.thisViewsStyle, {marginLeft: screenWidthNegative}]}></View>

Hastig Zusammenstellen
- 4,286
- 3
- 32
- 45