我使用react native创建了一个应用程序,我正在尝试生成apk.在http://facebook.github.io/react-native/docs/signed-apk-android.html#content的文档中完成后.发生错误,它表示无法读取脚本react-native\react.gradle',因为它不存在.
这是错误
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\User\Desktop\Aaa\android\app\build.gradle' line: 68
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not read script 'C
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of …Run Code Online (Sandbox Code Playgroud) 我的代码有问题.我对第二张表的反应相同.在第一个中它进入下一列.
PHP
$sql = "SELECT * from schedule s, matches m GROUP BY s.id";
$con = mysqli_connect($server_name,$mysql_user,$mysql_pass,$db_name);
$result = mysqli_query($con,$sql);
$response = array();
while($row=mysqli_fetch_array($result))
{
array_push($response, array("start"=>$row[4],"end"=>$row[5],"venue"=>$row[6], "teamone"=>$row[8], "teamtwo"=>$row[9],
"s_name"=>$row[17]));
}
echo json_encode (array("schedule_response"=>$response));
mysqli_close($con);
?>
Run Code Online (Sandbox Code Playgroud)
这是我得到的回应.正如你可以看到teamone,teamtwo和s_name都是一样的.它没有获得第二列的值.
{"schedule_response":[
{"start":"2016-11-23 00:00:00","end":"2016-11-24 00:00:00","venue":"bbbb",
"teamone":"aaa","teamtwo":"hehe","s_name":"sssss"},
{"start":"2016-11-22 00:00:00","end":"2016-11-23 00:00:00","venue":"aaaaaaa",
"teamone":"aaa","teamtwo":"hehe","s_name":"sssss"}]}
Run Code Online (Sandbox Code Playgroud)
当在react-native中的Flatlist中单击一行时,如何使Flatlist导航到下一个屏幕?
编辑:我在JS文件中发布了所有代码.
这是我的平面列表代码:
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
FlatList,
Button,
TouchableOpacity,
TouchableHighlight
} from 'react-native'
const Tasks = (props) => {
const { navigate } = props.navigation;
return (
<View style={styles.container}>
<FlatList
data={[
{key: 'Task 1'},
{key: 'Task 2'},
{key: 'Task 3'},
{key: 'Task 4'},
{key: 'Task 5'},
]}
renderItem={({item}) => <TouchableHighlight onPress={() => this.goToNextScreen()}>
<Text style={styles.item}>{item.key}</Text>}
</TouchableHighlight>}
/>
<TouchableOpacity style={{ height: 50, marginTop: 5, marginLeft: 100, marginRight: 100 }}>
<Button
onPress={()=>navigate('Steps')} …Run Code Online (Sandbox Code Playgroud)