react / react/react-native

Transform rotate style property doesn't work properly on ios

未关闭
#30,523 3 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Issue: Author Provided Repro Platform: iOS
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

I use @react-native-community/slider and I needed to rotate the slider.

To do so I used the css property transform, and rotate. It works well on android, but not on ios.
The slider stay to it's original position.
When I change the rotate value while I'm visualizing the slider, it rotates after the automatic assets refresh. But when I leave the screen and go back to it, the slider isn't rotated anymore.

React Native Version

0.63.4, (also experienced this behavior on 0.63.3).

Infos :

System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 60.75 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.19.0 - /var/folders/m1/qrp6lm356p5_802qt9vkc9tc0000gn/T/yarn--1606988176529-0.7023249601521031/node
Yarn: 1.22.10 - /var/folders/m1/qrp6lm356p5_802qt9vkc9tc0000gn/T/yarn--1606988176529-0.7023249601521031/yarn
npm: 6.14.8 - /usr/local/bin/npm
Watchman: 20200920.192359.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
Android SDK:
API Levels: 29, 30
Build Tools: 29.0.2, 30.0.2
System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6858069
Xcode: 12.2/12B45b - /usr/bin/xcodebuild
Languages:
Java: javac 15 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.4 => 0.63.4
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

Rotate an element with transform rotate style properties.

Expected result

The rotation is working on both android and ios.

Snack, code example, screenshot, or link to a repository:

The slider :
<Slider style={styles.fontSizeSlider} minimumValue={20} maximumValue={50} minimumTrackTintColor="#FFFFFF" maximumTrackTintColor="#000000" thumbTintColor="#FFFFFF" onValueChange={handleValueChange} value={textSize} />

Associated style :
fontSizeSlider: { flexBasis: '30%', width: 200, height: 40, transform: [{ rotate: '-90deg' }], },

The slider is under a flex container wich has the following css attributes :

inputContainer: { top: '50%', display: 'flex', flexDirection: 'row', flexWrap: 'wrap', alignContent: 'center', },

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

未指定 repository 文件或测试。首先在 iOS 上使用 -90deg 变换复现提供的 Slider 示例,并与 Android 进行比较,然后跟踪 React Native 在 iOS 上对 transform-style 的处理;当 slider 在导航和刷新后仍保持旋转状态,并且具有回归测试覆盖时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
ios, react-native
领域
mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。