小编gre*_*ory的帖子

ScrollView RTL in native native

以下代码是我ScrollViewreact native项目中的代码:

  <ScrollView
    ref={(scrollView) => { this._scrollView = scrollView; }}
    horizontal={true}
    showsHorizontalScrollIndicator={false}
    showsVerticalScrollIndicator={false}
    directionalLockEnabled={true}
    bounces={false}
    scrollsToTop={false}
  >
Run Code Online (Sandbox Code Playgroud)

现在它从左向右移动,如何在第一次加载时从右向左移动?

scrollview reactjs react-native

7
推荐指数
2
解决办法
985
查看次数

React Native - ios 中的 rtl

首先,我在 android 上工作并且 RTL 运行良好,我添加了以下代码:

   I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();
   sharedI18nUtilInstance.setAllowRTL(context, true);
Run Code Online (Sandbox Code Playgroud)

到 MainActivity.java 和

android:supportsRtl="true"
Run Code Online (Sandbox Code Playgroud)

到 AndroidManifest.xml

并在js代码中:

I18nManager.forceRTL(true);
Run Code Online (Sandbox Code Playgroud)

现在是问题:我尝试在 ios 上设置 rtl 但它不起作用我添加了

 // in AppDelegate.m
   [[RCTI18nUtil sharedInstance] allowRTL:YES];
Run Code Online (Sandbox Code Playgroud)

I18nManager.forceRTL(true);
Run Code Online (Sandbox Code Playgroud)

在 js 代码中,但所有文本和 flex 仍然是 ltr...我能做什么?

right-to-left ios react-native

5
推荐指数
2
解决办法
3030
查看次数

Fetch in react native不发送帖子

您好我正在尝试将post变量发送到我的API,而我没有在PHP文件中获取发布数据

这是我的反应本机代码:

let data = {
    method: 'POST',
    headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({
        'firstname': 'test',
    }),
}
fetch(GLOBALS.API + '/registerApi.php?key=' + GLOBALS.KEY, data)
.then((response) => response.json())
.then((responseJson) => {
    Alert.alert(
      'Alert Title',
      responseJson.output
    )

})
.catch((error) => {
    console.error(error);
});
Run Code Online (Sandbox Code Playgroud)

它让我空虚: []

$array = array(
    "output" => json_encode($_POST)
);
$output = json_encode($array);
die($output);
Run Code Online (Sandbox Code Playgroud)

当我使用$_REQUEST它时,只返回key没有firstname一个参数的get参数.

php post request react-native

2
推荐指数
2
解决办法
5435
查看次数

标签 统计

react-native ×3

ios ×1

php ×1

post ×1

reactjs ×1

request ×1

right-to-left ×1

scrollview ×1