keske / react-native-easy-gestures

React Native Gestures. Support: Drag, Scale and Rotate a Component.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get the width of the text rotated or scaled

idoor88 opened this issue · comments

Hi, I am trying to get the width of the text rotated or scaled, when I tried the following code:

<Text onTextLayout={(event) => this.measureText(event)} style={{fontFamily: "arialuni",fontSize: 20,padding:0,marginBottom:4, color: 'white', elevation: (Platform.OS === 'android') ? item.zindex : 50}}>{item.text}</Text>

I got event. nativeEvent as null, anybody knows why?
this test is on android device.

info Fetching system and libraries information...
System:
OS: macOS 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Memory: 111.93 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.4.0 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
Android SDK:
API Levels: 23, 25, 26, 27, 28
Build Tools: 27.0.3, 28.0.2, 28.0.3
System Images: android-22 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.1 AI-173.4907809
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: ^16.8.6 => 16.8.6
react-native: ^0.60.0 => 0.60.0
npmGlobalPackages:
react-native-asset: 2.0.0
react-native-cli: 2.0.1
react-native-cn-richtext-editor: 1.0.33
react-native-git-upgrade: 0.2.7

Thanks