通过使用此代码(在下面),该应用程序已被RTL,但位置的权利和;左变(所以东西必须显示在右变左).我通过tutorial做到了.

ReactNative.I18nManager.allowRTL(true);

另一个问题是,当移动的语言是LTR时,图像的位置&因为应用程序只有一种LTR语言,所以设计会变成另一面(例如从右到左的变化).有没有办法展示RTL&彼此喜欢吗??

推荐答案

您可以使用以下代码:

第一:

import { I18nManager } from 'react-native';

在应用程序类中,第二个选项是:

constructor(props) {
    super(props);
    I18nManager.forceRTL(true);
}

比如:

import React, { Component } from 'react';
import { View, I18nManager } from 'react-native';
import { Header } from './src/components/common';
import LoginForm from './src/components/LoginForm';

class App extends Component {

  constructor(props) {
    super(props);
    I18nManager.forceRTL(true);
  }
  render() {
    return (
      <View>
        <Header headerText="Authentication" />
        <LoginForm />
      </View>
    );
  }
}

export default App;

React-native相关问答推荐

react 本机中的TextInput对齐中的长文本

Touchabble 不透明度不工作-react 本机

React Native - 何时调用componentWillUnmount?

Jest 遇到了带有 react-native 的意外令牌

Android Studio 为构建设置 node 目录(Cause: error=2, No such file or directory)

在选项卡更改时react-navigation

混合 JavaScript 移动开发 - Apache Cordova vs Capacitor with Ionic vs NativeScript vs React Native

给定 APK 文件,我如何检测应用程序是否使用 React Native?

React Native Card Carousel 视图?

React Native 开发中的/ios/index/DataStore文件夹是什么

使用 Android NDK 在 C 或 C++ 中创建 react-native Native Module?

错误:安装 react-native-elements 后无法识别字体系列 Material Design 图标?

Xcode 12 问题:Build input file cannot be found

React native + redux-persist:如何忽略键(黑名单)?

React Native 元素搜索栏边界线未清除

React Nativedropped so far性能监视器计数不断增加

React Native 无法运行堆栈跟踪

如何将时刻日期转换为字符串并删除时刻对象

居中图像 React Native 加载屏幕

为react-native TextInput 设置边框