javascript React Native Handy

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript React Native Handy相关的知识,希望对你有一定的参考价值。

import call from 'react-native-phone-call';

const args = {
  number: this.state.contactDirectly, // String value with the number to call
  prompt: true // Optional boolean property. Determines if the user should be prompt prior to the call 
}
 
call(args).catch(()=>null)
import React, { Component } from "react";
import { Header } from "react-native-elements";
import EStyleSheet from 'react-native-extended-stylesheet';
import {Platform} from 'react-native';

class AppBarNE extends Component {
  constructor(props) {
    super(props);

    this.state = {
      headerTitle: this.props.title ? this.props.title : "Explore"
    };

    this.performDrawerToggle = this.performDrawerToggle.bind(this);
  }

  performDrawerToggle() {
    if (this.props.toggleDrawer) {
      this.props.toggleDrawer();
    }
  }

  render() {
    return (
      <Header
        outerContainerStyles={styles.headerOuterContainer}
        leftComponent={{
          icon: "menu",
          color: "#fff",
          underlayColor: "#252525",
          onPress: () => this.performDrawerToggle()
        }}
        centerComponent={{
          text: this.state.headerTitle,
          style: styles.centerComponent
        }}
        rightComponent={{
          icon: "search",
          color: "#fff"
        }}
      />
    );
  }
}

export default AppBarNE;


const styles= EStyleSheet.create({
  headerOuterContainer: {
      backgroundColor: '$secondaryBackground',
      borderBottomWidth: 0,
      shadowOpacity: 1,
      shadowOffset: {
          height: 1
      },
      shadowRadius: 1,
      height: Platform.OS === 'ios'
          ? 75
          : 75 - 24
  },
  centerComponent: {
      color: '#fff',
      fontSize: 17,
      fontFamily: 'Roboto',
      fontWeight: 'bold'
  }
});

以上是关于javascript React Native Handy的主要内容,如果未能解决你的问题,请参考以下文章

react-native: ios原生调用js方法

未找到 react-native-firebase FirebaseCore/FirebaseCore.h

React Native Config.h not found

react native 怎么动态修改 opacity

react-native-webview 如何注入 javascript?

在React native的iOS项目中找不到“config.h”文件