小编TRI*_*URI的帖子

无法从 react-native-dropdown-picker 中选择项目

我正在使用 React-native-dropdown-picker,但是我无法从下拉列表中选择任何项目,这些项目被下面的视图重叠。我试过添加 position:'absolute, zIndex:2 但仍然是 itemlist 重叠如下: 在此处输入图片说明

我已经编写了下拉组件的代码如下

 return (
    <View>
      <View style={styles.container}>
        {console.log('new array', dateArr)}
        {console.log('arr', arr)}
        <Icon
          name="arrow-left"
          size={20}
          color="#fff"
          style={{marginTop: 12}}
        />
        {console.log('----------date', dateArr)}
        {dateArr != null && (
          <DropDownPicker
            onValueChange={(value) => onValSelect(value)}
            items={dateArr}
            itemStyle={{
              // justifyContent: 'flex-start',
              flexDirection:'row'
            }}
            
            containerStyle={{height: 40,width:'80%',zIndex:2}}
          />
        )}
       
      </View>
      <DaysInAWeek daysInAWeek={daysInAWeek} />
    </View>
  );
}
const styles = StyleSheet.create({
  container: {
    backgroundColor: '#FE017E',
    // height: 56,
    width: '100%',
    flexDirection: 'row',
    padding: 10,
  },
});
Run Code Online (Sandbox Code Playgroud)

onValSelect() 如下:

 function onValSelect(val) {
    if (val.length …
Run Code Online (Sandbox Code Playgroud)

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

4
推荐指数
1
解决办法
6004
查看次数

安装 react-native-image-crop-picker 后构建失败

我已经安装了 react-native-image-crop-picker,当我尝试开始构建时安装时收到以下错误:

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     D:\Parentlane\ParentlanePregnancyApp\node_modules\react-native-image-crop-picker\android\build\intermediates\library_manifest\debug\AndroidManifest.xml:10:5-14:15: AAPT: error: unexpected element <queries> found in <manifest>.
Run Code Online (Sandbox Code Playgroud)

我尝试清洁,然后再次运行,但它不起作用。我也启用了 multidex 但这似乎也不起作用。

下面是我的 AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.parentlanepregnancyapp">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>
Run Code Online (Sandbox Code Playgroud)

应用程序/build.gradle

apply plugin: "com.android.application"

import com.android.build.OutputFile



project.ext.react = [
    enableHermes: …
Run Code Online (Sandbox Code Playgroud)

android gradle react-native react-native-android

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

如何访问对象内部的数据?

我已经在本地存储中设置了一个 JSON 对象,并且能够获取它并将其设置在vaccine_data 状态中,但是每当我尝试调用对象中的任何项目时,我都会将其定义为值。

//state
const [vaccine_data, setVaccine_data] = useState([]);

//localstorage data
useEffect(() => {
    setVaccine_data(localStorage.getItem('data'));
    console.log('+++--vaccine_data');
    console.log(vaccine_data);
  // console returning
/*
{"startDate":1,"endDate":7}
  });
*/
}

//inside return
return (

    {console.log('+++++',vaccine_data)} // returning data
     {vaccine_data && vaccine_data!='' && vaccine_data!=null &&(
              console.log('aaaa',vaccine_data.startDate)
            )} // returning undefined

)
Run Code Online (Sandbox Code Playgroud)

已提供指定我的疑问的代码,如果需要其他任何内容,请告诉我。

请让我知道如何访问对象内部。任何帮助,将不胜感激

javascript json local-storage reactjs react-native

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

运行react-native run-android时,配置项目':react-native-audio-recorder-player' &gt;compileSdkVersion未指定时出现问题

每当我尝试运行react-native run-android时,我都会收到以下错误:

A problem occurred configuring project ':react-native-audio-recorder-player'.
> compileSdkVersion is not specified.
Run Code Online (Sandbox Code Playgroud)

构建.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
    minSdkVersion = 21
    compileSdkVersion = 28
    targetSdkVersion = 28
    
    androidXAnnotation = "1.1.0"
    androidXBrowser = "1.0.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.5.3")
        classpath 'com.google.gms:google-services:4.2.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    } …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-ios

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