标签: react-native-android

React-Native List不滚动

问题是listview不滚动.我试过很多款式,但我找不到方法.我使用React-Native 0.39.2.我试过Android设备

    /**
     * Sample React Native App
     * https://github.com/facebook/react-native
     * @flow
     */

import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, TextInput } from 'react-native'; //import MapView from 'react-native-maps'; import { Button,CheckBox} from 'react-native-elements' import { List, ListItem } from 'react-native-elements' export default class Kpss extends Component { constructor(props) { super(props); } render() { const list = [ { name: 'Amy Farha', avatar_url: 'https://s3.amazonaws.com/uifaces/faces/twitter/ladylexy/128.jpg', subtitle: 'Vice President' }, { name: 'Chris Jackson', avatar_url: 'https://s3.amazonaws.com/uifaces/faces/twitter/adhamdannaway/128.jpg', subtitle: …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-listview react-native-android

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

使用react-native bundle(Android)创建发布版本后返回调试

所以我使用React native创建了我的应用程序,并且刚刚创建了我的第一个发布版本.我现在的问题是我无法回复原生调试模式.

通过遵循文档,这就是我所做的.

react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/
Run Code Online (Sandbox Code Playgroud)

这段代码生成了捆绑index.android.bundle和index.android.bundle.meta

现在每次执行时react-native run-android,javascript代码库都不会更新应用程序,我无法访问我的应用程序中的开发(摇动)菜单.

如果我react-native bundle再次运行,代码将更新.

我想这是一个简单的问题,但无法找到任何信息如何返回,所以应用程序不再使用捆绑版本.

react-native react-native-android

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

如何在React Native中使用多个视图进行拖放?

我在动态相同的位置添加了多个视图,还添加了pan Gesture的每个视图.所有视图都在同一位置,以便覆盖.我的问题是,当想要拖动最后一个视图时,它会拖动所有视图.如何拖动单个视图.

在这里你可以看到所有观点的GIF.View1,View 2和View 3.所有都是拖动.我想只查看3是可拖动的,其他拖动完成后拖3.

1.拖动3 - 首先拖动.

2.拖动2 - 拖动.

3.拖动1 - 第三次拖动.

代码:

import React, { Component } from 'react';
import {
  StyleSheet,
  View,
  Text,
  PanResponder,
  Animated,
  Easing,
  Dimensions,
  Platform,
  TouchableOpacity,
} from 'react-native';

let CIRCLE_RADIUS = 36;
let Window = Dimensions.get('window');
const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' +
    'Cmd+D or shake for dev menu',
  android: 'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});

export …
Run Code Online (Sandbox Code Playgroud)

reactjs react-native react-native-android react-native-ios

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

反应本地谷歌地图替代

我在Android上有一个React Native项目。

我已经安装了react-native-maps并且一切正常,但是我需要在没有 google服务(例如TomTom导航器)的android设备上运行我的应用程序。

有谷歌地图的替代品吗?(bing,openstrett等)谢谢

google-maps openstreetmap bing-maps react-native react-native-android

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

我滚动之前,RecyclerView不会更新子级

I think I've read pretty much all the answers to all of the similar SO questions, and NONE of them seem to be working for me. It's driving me nuts, and I've spent too much time on this.

I'm implementing a RecyclerView here and I can't for the life of me update it's children. What happens is that after I update nothing changes on the screen, UNLESS I start scrolling. Once I scroll it updates perfectly.

This is my …

android android-recyclerview react-native recyclerview-layout react-native-android

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

反应原生文本输入Android光标/插入符号和文本光标颜色

我正在努力使用React Native Text Input组件,似乎无法找到更改光标颜色和android上文本选择指示器的方法.

官方文档仅列出了选择颜色的支柱(文本的突出显示背景).

有没有办法在不改变全局的情况下做到这一点?如果在全球范围内更改它是正确的方法,那么最好的方法是什么?在styles.xml中更改它?当我尝试更改它时,React-Native崩溃.

android textinput react-native react-native-android

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

连续文本组件中的空文本空间反应原生

我有这个问题:

在此输入图像描述

我需要在第一行中加上"dummy"这个词,直到该行完成.

您可以在此处查看示例:https://snack.expo.io/B1KcRgGWX

代码:

import React, { Component } from 'react';
import { Text, View, StyleSheet } from 'react-native';
import { Constants } from 'expo';

export default class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <View style={styles.paragraphs}>
          <Text style={styles.textParagraph}>Lorem Ipsum is</Text>
          <Text style={styles.emptyTerm} />
          <Text style={styles.textParagraph}>dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-android

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

急速模块图中不存在模块“反应”

我正在尝试在我的应用程序中进行LinkedIn集成。所以,我做了如下:

安装的依赖项如下:

npm install react-native-linkedin --save;

因此,在启动应用程序时,出现以下错误:

Failed to load bundle(http://localhost:8081/index.bundle?
platform=ios&dev=true&minify=false)with
error:(Unable to resolve module 'react' from
'mypath/App.js':Module 'react' does not exist
in the Haste module map
Run Code Online (Sandbox Code Playgroud)

可能是什么问题?谢谢。

linkedin react-native linkedin-api react-native-android react-native-ios

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

如何在React Navigation中的堆栈导航内添加抽屉

我正在进行一个诸如登录/注册应用程序之类的实践项目,并且正在从反应导航中使用堆栈导航,并且它运行良好,

现在,当用户登录时,他应该被重定向到仪表板屏幕,我想要在标题右侧添加一个抽屉 “我还添加了屏幕截图”,我也在堆栈导航中创建了仪表板屏幕,我不知道如何添加堆栈导航中的那个抽屉,我只想在我的仪表板屏幕上放置一个抽屉,以便有人可以提供帮助?谢谢

这就是我要在仪表板屏幕上显示的内容

App.js(在其中添加了所有堆栈屏幕的位置)

    import React from 'react';

    import { createStackNavigator, createDrawerNavigator } from 'react-navigation';

    import HomeScreen from './screens/HomeScreen';
    import LoginScreen from './screens/LoginScreen';
    import RegisterScreen from './screens/RegisterScreen';
    import Dashboard from './screens/Dashboard';

    const StackNavigation = createStackNavigator({
      HomeStack: HomeScreen,
      LoginStack: LoginScreen,
      RegisterStack: RegisterScreen,
      DashboardStack: Dashboard,

    }, {
        initialRouteName: 'HomeStack',
      });

      const DrawerNav = createDrawerNavigator({
        DashboardStack: Dashboard,
      })


    export default class App extends React.Component {
      render() {
        return (
          <StackNavigation />
        );
      }
    }
Run Code Online (Sandbox Code Playgroud)

Dashboard.js

    import React from 'react';
    import …
Run Code Online (Sandbox Code Playgroud)

android react-native react-native-android react-navigation react-navigation-drawer

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

错误:找不到符号:变量Build.VERSION_CODES.O_MR1

我正在尝试实现一个本机模块,该模块在react native中提供连接服务。但是我面临一个错误。由于我不是一名android / java开发人员,因此无法找到以下错误的原因。

E:\projects\deets-mobile-cp\node_modules\react-native-connection-service\android\src\main\java\com\genm\CallConnection.java:10: error: cannot find symbol
    @TargetApi(Build.VERSION_CODES.O_MR1)
                                  ^
      symbol:   variable O_MR1
      location: class VERSION_CODES
    E:\projects\deets-mobile-cp\node_modules\react-native-connection-service\android\src\main\java\com\genm\CallConnection.java:14: error: cannot find symbol
            setConnectionProperties(PROPERTY_SELF_MANAGED);
                                    ^
      symbol:   variable PROPERTY_SELF_MANAGED
      location: class CallConnection
Run Code Online (Sandbox Code Playgroud)

CallConnection.java

package com.genm;

import android.annotation.TargetApi;
import android.os.Build;
import android.telecom.Connection;
import android.util.Log;

import static android.content.ContentValues.TAG;

@TargetApi(Build.VERSION_CODES.O_MR1)
public class CallConnection extends Connection{

    public CallConnection(){
        setConnectionProperties(PROPERTY_SELF_MANAGED);
        setAudioModeIsVoip(true);
    }

    @Override
    public  void onAnswer(){
        Log.d(TAG, "On answer to the call");
    }

}
Run Code Online (Sandbox Code Playgroud)

android react-native react-native-android

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