标签: react-native-android

React-native开发选项未显示在小米手机上安装的移动应用程序上

当我尝试在我的redmi note 3手机上安装react-native app时,会弹出一个错误,当我使用任何其他手机时都不会发生这种错误.我通过禁用MIUI优化来解决此问题.但是在我这样做之后,当我摇动我的手机时,我没有获得开发选项.

android react-native react-native-android

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

在React-Native应用程序发布版本中看不到本地图像

在我的react-native应用程序中,我有"src"文件夹,其中包含Images文件夹和屏幕文件夹.我的屏幕文件夹有各种组件,我使用以下代码从图像中获取本地图像.

<Image source={require('src/Images/logo.png')} />
Run Code Online (Sandbox Code Playgroud)

logo.png是放置在Images文件夹中的图像,还有更多这样的图像像这样被引用.现在所有这些图像都在开发模式中很好地显示但是当我使用gradlew assemblerelease生成发布apk并在我的设备上安装apk时所有图像以这种方式引用消失在某处.不知道是什么原因所以请帮助我.我的react-native版本是0.40

release image local react-native-android

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

用反应原生的作物图像

你好,世界,

我试图在React-native Doc上裁剪像解释一样的图像

<Image source={{uri: this.props.image, crop: {left: 50, top: 50, width: 100, height: 100}}} style={{height: 100, width: 100}}/>
Run Code Online (Sandbox Code Playgroud)

但它不起作用图像不被裁剪.

任何的想法?

crop react-native react-native-android react-native-ios react-native-image

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

React和React Native之间有什么相似之处

这两者有什么相似之处?我知道它们是针对不同平台而制作的,React适用于Web,React Native适用于移动设备.但它们都是由Facebook制作来解决类似的问题.那么,有重叠吗?有相似之处吗?

javascript reactjs react-native react-native-android

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

在不占用更多高度的情况下获得与... StyleSheet.absoluteFillObject相同的效果

我必须location从此样式表添加:

const mapStyles = StyleSheet.create({
  container: {
    ...StyleSheet.absoluteFillObject,
    height: 400,
    width: 400,
    justifyContent: 'flex-end',
    alignItems: 'center',
  },
  location: {
    ...StyleSheet.absoluteFillObject,
    width: 400,
    alignItems: 'center',
  }
})
Run Code Online (Sandbox Code Playgroud)

到我的自动填充(<Location />),以便在Android上自动填充列表将溢出其他组件。

例如:

    <Container style={mapStyles.location}>
    <Location />
    </Container>
Run Code Online (Sandbox Code Playgroud)

但是,似乎将下方的元素<Location />向下推至其下方的设备屏幕高度左右(因此,在下方有一个完整的空白屏幕<Location />,然后出现其他组件。我如何获得与...StyleSheet.absoluteFillObject将组件进一步向下移动时获得的效果相同的效果屏幕?

javascript reactjs react-native react-native-android

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

如何使用单个处理程序处理多个TextInput句柄?

我为TextInput创建了通用类,并多次使用了它,但是它的事件句柄具有相同的方法。我想在将数据填充到textInput中之后处理数组数据。

在这里添加了多个textField和single handleAddMore。如何识别哪个textInput称为handleAddMore。

textField组件根据数组数据动态添加。现在,当用户编辑textInput时,我想在特定索引上标识textInput和更新的数组文本。

let addMoreCompView = this.state.dataAddMore.map((data ,index) =>{
 return(
   <View style ={[styles.commonMargin ,{flexDirection : 'row',marginTop : 2 , height : 40, backgroundColor : Globle.COLOR.INPUTCOLOR}]}>
     <View style = {{height : '100%' , width : '80%' , justifyContent: 'center' ,alignItems: 'flex-start', flexDirection : 'column'}}>
         <TextInput style = {{fontFamily: 'Gotham-Light',fontSize : 14 ,color: Globle.COLOR.BACKCOLOR , paddingLeft : 20}}
              underlineColorAndroid = "transparent"
              placeholder = 'Please enter emailID.'
              placeholderTextColor = 'black'
              autoCapitalize = "none"
              keyboardType = "email-address"
              onSubmitEditing ={Keyboard.dismiss}
              onChangeText …
Run Code Online (Sandbox Code Playgroud)

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

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

无法创建android版本:java.io.FileNotFoundException(../ node_modules/react-native/undefined)

从我的react-native项目的android文件夹项目执行./assembleRelease时,我收到以下错误:

12:47:38.876 [ERROR] [org.gradle.BuildExceptionReporter] Failed to capture snapshot of input files for task 'bundleReleaseJsAndAssets' during up-to-date check.
12:47:38.876 [ERROR] [org.gradle.BuildExceptionReporter] > java.io.FileNotFoundException: /Users/michiel/Sites/Erbij/erbij/node_modules/react-native/undefined (Operation not supported on socket)
Run Code Online (Sandbox Code Playgroud)

iOS版本很好,本地开发适用于Android和iOS.有没有人知道从哪里开始搜索?与试图运行--verbose,--info并且--debug,没有运气.

我也尝试剥离我的整个javascript代码,并让App.js成为渲染和清空视图的简单组件.

react-native react-native-android

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

切换标签时如何动态更改标题导航标题

我有2个标签,并放入其中 createStackNavigator

我在用

“ react-navigation”:“ ^ 2.0.1”, “ react-native”:“ 0.55.3”,

const Cstack = createStackNavigator({
    cstack: {
        screen: Screen1,
    }
},{
    headerMode:'none'
});


const Dstack = createStackNavigator({
    dstack: {
        screen: Screen2,
    },
},{
    headerMode:'none'
});
const mytabnavigator= createTabNavigator({
    Tab1: {
        screen: Cstack,
        navigationOptions: ({navigation}) => ({
            headerTintColor: 'white',
            tabBarIcon: ({focused, tintColor}) => {
                return (
                    <IconIonicons
                        name='ios-cash'
                        type='ionicon'
                        color="#FFFFFF"
                        size={26}
                    />
                );
            },

        })
    },
    Tab2: {
        screen: Dstack,
        navigationOptions: ({navigation}) => ({
            headerTintColor: 'white',
            tabBarIcon: ({focused, tintColor}) => {

                return …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-android react-navigation

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

React native app keeps an old version in release

I have made many changes in my js code, when I run in debug mode I'm able to see all the changes but when I run the app in release mode or generate a release apk, the changes that were made and visible in debug mode are not visible.

What I have already tried?

react-native run-android --variant=release
Run Code Online (Sandbox Code Playgroud)

删除资产中的builds文件夹和android.bundle.js

react-native react-native-android

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

为什么我应该/不应该升级到本机0.60.0?

当前,react-native已发布了0.60.0版,并且进行了重大更改,但他们在此版本中添加了许多本机支持。

我目前在做3个项目。

First Project Info
- react: 16.0.0-beta.5 => 16.0.0-beta.5
- react-native: 0.49.0 => 0.49.0
this project containes lots of third party libraries and some of them not event maintained by owners.

Second Project Info
- react: 16.6.3 => 16.6.3
- react-native: 0.57.8 => 0.57.8
this project containes 12 third party libraries.

Third Project Info
- react: 16.8.5 => 16.8.5
- react-native: 0.59.2 => 0.59.2
this project containes 7 third party libraries.

Currently, all three projects are working in debug …

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

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