小编dev*_*edv的帖子

从堆栈导航器中删除屏幕

我观察到Back按钮逻辑可以看到堆栈中的屏幕序列.我有一个放置在堆栈导航器中的抽屉导航器.

在堆栈顶部我有Splash画面.在仪表板上,当我按下后退按钮时,我需要启动屏幕.

进入应用程序后,如何从堆栈中删除启动画面,因此当我按下后退按钮仪表板时,它将退出应用程序,而不是转到SPLASH SCREEN.

/* @flow */

import React from "react";
import { Platform, Text } from "react-native";
import { Root } from "native-base";
import { StackNavigator, DrawerNavigator} from "react-navigation";
import Register from "./components/Register";
import Available from "./components/Available";
import Splash from "./components/splash/“;
import SideBar from "./components/sidebar";
import Discover from "./components/Discover/";
import Dashboard from "./components/Dashboard/";
import Contact from "./components/Contact"



const Drawer = DrawerNavigator(
  {
    Dashboard: { screen: Dashboard },
    Discover: { screen: Discover },
    Contact: { screen: Contact},
      },
  {
    navigationOptions: …
Run Code Online (Sandbox Code Playgroud)

react-native react-navigation

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

标记多个日期动态反应本机 wix

我正在使用 react-native-calendars。一旦将标记参数传递给日历对象,该库就提供了在日历上标记日期的能力。我尝试传递一组对象,但没有发送多个日期,如下所示。

如何在其上动态标记多个日期?

var nextDay =['2018-06-01',
       '2018-06-05',
       '2018-06-08',  
       '2018-06-07',
       '2018-06-18',
       '2018-06-17',
       '2018-05-28',
       '2018-05-29'];

   const mark = {
    [nextDay]: {selected: true, marked: true}
   };

this.state(
{
mark: mark,
})

          <Calendar
      onDayPress={this.onDayPress}      
      current={new Date()}
      minDate={'2018-05-24'}
      onMonthChange={(month) => {console.log('month changed', month)}}
      hideArrows={false}
      hideExtraDays={true}
      disableMonthChange={false}
      firstDay={1}
      hideDayNames={false}
      showWeekNumbers={false}
      onPressArrowLeft={substractMonth => substractMonth()}
      onPressArrowRight={addMonth => addMonth()}
      markedDates={this.state.mark}

          theme={{
            backgroundColor: '#ffffff',
            calendarBackground: '#ffffff',
            textSectionTitleColor: '#b6c1cd',
            selectedDayBackgroundColor: '#00adf5',
            selectedDayTextColor: '#ffffff',
            todayTextColor: '#00adf5',
            dayTextColor: '#2d4150',
            textDisabledColor: '#d9e1e8',
            dotColor: '#00adf5',
            selectedDotColor: '#ffffff',
            arrowColor: 'orange',
            monthTextColor: 'blue',
            textMonthFontWeight: 'bold',
            textDayFontSize: 16, …
Run Code Online (Sandbox Code Playgroud)

react-native

6
推荐指数
1
解决办法
5854
查看次数

Skype API - 拨打电话和发送消息

有没有办法用 C# 或任何其他语言实现 Skype API。

我使用的是 Skype4com.DLL,但它已被弃用,不能与 Skype 最新更新一起使用。我在 Skype 插件(Windows 应用程序)中使用它来登录和拨打电话。作为替代方案,我认为 UCWA Skype Web SDK 将是最佳解决方案,但它有不同的用途。

有些公司仍在使用它,例如https://www.minutizer.com/。我无法弄清楚他们如何检测呼叫和消息。

需要帮助!谢谢

c# skype skype4com skypedeveloper

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

字体大小React native

在响应本机应用程序中,什么是处理字体大小的最佳方法。

我有一个奇怪的问题,如果从移动设备的显示设置中增加字体大小,它也会更改应用程序的fontSize。我使用了fontSize:14(任何值),因此它根据移动设备的字体大小选择大小14,整个应用程序的字体大小增加,UI看起来很恐怖。

我也尝试过使用宽度和高度来调整fontSize,但是在所有设备上看起来也不是很好。

const WIDTH = Dimensions.get('window').width;
const HEIGHT = Dimensions.get('window').height;
Run Code Online (Sandbox Code Playgroud)

reactjs react-native

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

包围反应本机矢量图标

我想圈出反应本机矢量图标。我在样式中添加了边框半径,但它对所有设备都没有帮助,而且每个图标的行为都不同。

    <Icon  name={'ios-grid-outline'} style={{ color: "rgb(170, 207, 202)", 
 borderRadius:10,
  borderWidth: 2,
  borderColor: 'rgb(170, 207, 202)',
}} />
Run Code Online (Sandbox Code Playgroud)

反应本机矢量图标的链接: https://oblador.github.io/react-native-vector-icons/

在此输入图像描述

react-native

3
推荐指数
1
解决办法
9835
查看次数

反应本机基本标题中心对齐

我正在使用本机反应。我想在iOS和android两者中居中对齐标题,因为文本很长,所以用“…”将其隐藏。flex:3完全应用显示标题,但不会使标题居中对齐。即使申请alignItems: 'center',alignSelf: 'center'也无济于事。

我试过其他选项无法修复它。我该如何解决?

码:

 <Header  iosStatusbar="light-content" androidStatusBarColor='#000' >
<Left style={{flex:1}}>
<Button transparent onPress={() =>  this.navigateCustom("goBack")}>
 <Icon name="arrow-back" />
 </Button>
</Left>

    <Body style={{flex:3,}}>
     <Title>THIS IS A LONG TITLE TEST</Title>
   </Body>

  <Right style={{flex:1}}>
  <Button transparent onPress={()=> this.navigateCustom("DrawerOpen") }>
     <IconEvil  name={"menu"}  style={{ color: "rgb(255,255,255)", fontSize:30}}/>
     </Button>
  </Right>
      </Header>
Run Code Online (Sandbox Code Playgroud)

编辑:将flex:1和身体的中心对齐后 在此处输入图片说明

react-native native-base

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

在React Native中实现深层链接

我正在React Native应用程序中实现深层链接,以在应用程序A中单击“视图”以打开应用程序B。在直接从另一个应用程序调用URL之前,我想对其进行测试,

因此,对于android来说,它确实有效。我只是将启动选项设置为URL,它在控制台中显示了URL的值。

但是在iPhone中,如果我在Safari浏览器中编写URL(testlink://),则会显示“ Safari无法打开页面,因为地址无效”。

我遵循的设置深度链接的步骤:

  1. 在AppDelgate.m中添加了以下代码

    #import <React/RCTLinkingManager.h>
    
    - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
      sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
    {
      return [RCTLinkingManager application:application openURL:url
                          sourceApplication:sourceApplication annotation:annotation];
    }
    
    - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
     restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
    {
     return [RCTLinkingManager application:application
                      continueUserActivity:userActivity
                        restorationHandler:restorationHandler];
    }
Run Code Online (Sandbox Code Playgroud)

  1. 在XCode的info.plist中添加了一个键。

    URLTypes->项目0-> URL标识符(值:testlink)

  2. 在应用程序的主页中添加以下代码。

   

 componentDidMount() {
      Linking.addEventListener('url', this._handleOpenURL);
    },
    componentWillUnmount() {
      Linking.removeEventListener('url', this._handleOpenURL);
    },
    _handleOpenURL(event) {
      console.log(event.url);
    }
Run Code Online (Sandbox Code Playgroud)

ios react-native

0
推荐指数
1
解决办法
1016
查看次数

使用 React Native 通过 Twilio 发送短信 (SMS)?

如何在 React Native 中使用 twilio 发送短信?

我在文档中没有找到任何与本机反应相关的内容。

下面的代码无法发送短信。

  fetch('https://api.twilio.com/2019-01-01/Accounts/ACxxxxxxxxxxx/Messages',
    {
            method: 'POST',
            headers: {
                Accept: 'application/json',
                'Content-Type': 'application/json',
                    },


                body: JSON.stringify({
                      user:'ACxxxxxxxxxxxxxxxxxxxxxxx',
                      password:'xxxxxxxxxxxxxxxxxxxxxxxxx',
                      to: '+xxxxxxxxxx',
                      body: 'test',
                      from: '+xxxxxxxxxxx',

                       }),
                    }) .then((response) => {
                      console.log(JSON.stringify(response))
                      alert(JSON.stringify(response))
                    })
                    .catch((error) => {
                      alert('error' + error);
                    });
Run Code Online (Sandbox Code Playgroud)

错误:

I/ReactNativeJS: {"type":"default","status":401,"ok":false,"headers":{"map":{"connection":"keep-alive","content-length" :"327","x-powered-by":"AT-5000","x-shenanigans":"none","www-authenticate":"Basic realm=\"Twilio API\"","access- control-allow-headers":"Accept, Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since","date":"Tue, 08 Jan 2019 09 :22:05 GMT","access-control-allow-methods":"GET, POST, DELETE, OPTIONS","twilio-request-id":"RQ4e86455b1a2446afb35feab5ea5f0789","access-control-allow-credentials":"真的”,”access-control-allow-origin":"*","access-control-expose-headers":"ETag","content-type":"application/xml","twilio-request-duration":"0.003" ,"strict-transport-security":"max-age=31536000"}},"url":" https://api.twilio.com/2010-04-01/Accounts/AC8xxxxxxxxxxxxxxxxX/Messages","_bodyInit":"\n20003您的 AccountSid 或 AuthToken 不正确。身份验证错误 - 未提供凭据https://www.twilio.com/docs/errors/20003 401","_bodyText":"\n20003 …

twilio react-native

0
推荐指数
1
解决办法
2139
查看次数