小编Har*_*iks的帖子

渲染Modal,iOS Actionsheet选择器组件时,React Native上的浮动按钮(FAB)不会停留在顶部

在较高级别的组件中使用绝对定位的按钮将在正常使用情况下发挥作用,但是当呈现模式/动作表/选择器等时,该按钮将不再位于顶部。在此处输入图片说明

android ios floating-action-button react-native

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

阿波罗与redux-persist

我集成了react-apollo,用于将我的GraphQL服务器中的数据提取到我的react本机应用程序中.我使用redux-perist来持久化和再水化redux商店.

但我不知道如何补充我的阿波罗州.

谁知道我怎么能这样做?

谢谢

apollo react-native react-redux react-apollo

5
推荐指数
1
解决办法
917
查看次数

React Native 链接外部应用程序

问题

在我的反应本机应用程序中,我想启动一个名为“Taco Shop”的外部应用程序。我正在使用包react-native-app-link。我想从我的应用程序内启动此应用程序,但如果未安装,请将用户带到应用程序商店。

代码

var url = "tacoshop://";  <-----NO CLUE WHERE OR HOW I GET THIS URL
var appName = 'Taco Shop';
var appStoreId = 'id1185454813';
var playStoreId = 'io.simplyorder.tacoshop';


AppLink.maybeOpenURL(url, { appName, appStoreId, playStoreId }).then(() => {
  // do stuff
})
.catch((err) => {
  // handle error
});
Run Code Online (Sandbox Code Playgroud)

它会启动 google play/应用程序商店,但在安装时不会启动实际的应用程序。如果已安装,如何找到上面的 taco shop 应用程序的 URL 以直接启动?

android ios react-native

5
推荐指数
1
解决办法
619
查看次数

overFlow:'hidden' &amp;&amp; borderRadius 在 React Native Android 中无法正常工作

borderRadius 在 iOS 中按预期工作,但在 Android 中不按预期工作。我试图包裹Image在一个视图,并给borderRadiusoverFlow: 'hidden'

  <View style={styles.userImageContainer}>
    <Image source={require('../../assets/images/user1.png')}
    style={styles.userImage}
    />
  </View>
Run Code Online (Sandbox Code Playgroud)

样式表

const imageSize = 40;

  userImageContainer: {
    height: imageSize,
    width: imageSize,
    borderWidth: 1,
    alignItems: 'center',
    justifyContent: 'center',
    borderRadius: imageSize/2,
    overflow: 'hidden'
  },
  userImage: {
    height: imageSize,
    width: imageSize,
    borderRadius: imageSize/2,
    padding: 5,
    resizeMode: 'contain'
  },
Run Code Online (Sandbox Code Playgroud)

最终结果图像

我正在使用 RN 0.42.2

react-native react-native-android

4
推荐指数
1
解决办法
6278
查看次数

如何使用React Native包tcomb-form-native进行验证

在TextInput中输入电子邮件时,它应根据输入的电子邮件是否有效来验证并显示错误消息?我正在使用tcomb表单验证.如何以tcomb形式添加电子邮件验证?下面是代码.

import React, { Component } from 'react';
import {
  AppRegistry,
  Text,
  Image,
  View,
  Button,
  StyleSheet,
  TextInput,
  Linking,
  Alert,
  Navigator
} from 'react-native';
import t from 'tcomb-form-native';

const Form = t.form.Form;

// here we are: define your domain model
const LoginFields = t.struct({
  username: t.String,              // a required string
  password: t.String,   // a required string
});

const options = {
  fields: {
    password: {
      type: 'password',
      placeholder: 'Password',

    },
    username: {
      placeholder: 'e.g: abc@gmail.com',
      error: 'Insert a valid email'
    } …
Run Code Online (Sandbox Code Playgroud)

react-native

-1
推荐指数
1
解决办法
3123
查看次数