小编bor*_*ral的帖子

Expo Camera仅使用React Navigation打开一次

我通过反应导航将Expo相机设置为在中间选项卡上打开。但是,只有在我第一次单击该选项卡时,相机才会打开。如果我关闭它然后再返回,那只是一个黑屏。拍照按钮也不存在。(我是整体上本机和有点编码的新手)

'use strict';
import React, { Component } from 'react';
import { createBottomTabNavigator } from 'react-navigation';
import { Camera, Permissions } from 'expo';
import {
    AppRegistry,
    Dimensions,
    StyleSheet,
    Text,
    TouchableOpacity,
    View,
    Button
} from 'react-native';


class HomeScreen extends React.Component {
  render() {
    return (
      <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
        <Text>Home!</Text>
      </View>
    );
  }
}

class CameraView extends React.Component {
  state = {
    hasCameraPermission: null,
    type: Camera.Constants.Type.back,
  };

  async componentWillMount() {
    const { status } = await …
Run Code Online (Sandbox Code Playgroud)

navigation camera native reactjs expo

8
推荐指数
3
解决办法
958
查看次数

标签 统计

camera ×1

expo ×1

native ×1

navigation ×1

reactjs ×1