我正在将TouchableOpacity与嵌套在其中的图像进行映射.它适用于Android,但在iOS上,图像是不可见的.仍然有一个75x75可触摸的不透明度,我可以点击但图像在弹出的模式中是不可见的,一般来说.
这是如何运作的?我正在使用Expo SDK FileSystem来获取每个图像的路径.
例如:file://path/to/container/progress/myfilehash.jpg
我将其推送到我的状态并将其映射到组件中.require()函数对我这样做的方式不起作用.我认为这完全是渲染的问题.
地图代码:
{this.state.images.map((val, key) => (
<TouchableOpacity
key={key}
onPress={() => this.setState({active: val, modal: true})}
>
<Image
style={{width: 75, height: 75}}
source={{isStatic: true, uri: val}}
/>
</TouchableOpacity>
))}
Run Code Online (Sandbox Code Playgroud)
莫代尔:
<Container style={Colors.Backdrop}>
<Header style={Colors.Navbar}>
<Left>
<TouchableHighlight
onPress={() => {
this.setState({modal: false})
}}>
<Icon
name="arrow-back"
style={{color: 'white'}}
/>
</TouchableHighlight>
</Left>
<Body></Body>
<Right>
<TouchableOpacity
onPress={() => {
this._deleteImage(this.state.active);
}}>
<Text
style={[
Colors.ErrorText, {
fontSize: 24,
marginRight: 10
}
]}>×</Text>
</TouchableOpacity>
</Right>
</Header>
<Content>
<View
style={{flex: 1}}
>
<FitImage
source={{uri: …Run Code Online (Sandbox Code Playgroud) 是否可以检查客户端看到的金额以及服务器看到的金额是否相同?
在这里,我在客户端设置金额:
<script src="https://checkout.stripe.com/checkout.js"></script>
<button id="customButton">Purchase</button>
<script>
var handler = StripeCheckout.configure({
key: 'pk_test_1002UFB11gJ1sXBHcdDM8HPi',
image: '/square-image.png',
token: function(token) {
// Use the token to create the charge with a server-side script.
// You can access the token ID with `token.id`
}
});
document.getElementById('customButton').addEventListener('click', function(e) {
// Open Checkout with further options
handler.open({
name: 'Demo Site',
description: '2 widgets ($20.00)',
amount: 2000
});
e.preventDefault();
});
// Close Checkout on page navigation
window.addEventListener('popstate', function() {
handler.close();
});
</script>
Run Code Online (Sandbox Code Playgroud)
我将令牌从客户端条带回调发送到服务器:
<?php
require_once(dirname(__FILE__) . '/config.php'); …Run Code Online (Sandbox Code Playgroud) 我正在使用 laravel mix,如果我正确解释这个问题,我似乎无法找到反应。
我的测试:
import React from "react";
import renderer from "react-test-renderer";
import AppLayout from "../AppLayout";
test("it renders", () => {
const component = renderer.create(
<AppLayout pageTitle={undefined}>App</AppLayout>
);
let tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
Run Code Online (Sandbox Code Playgroud)
这是我的 package.json
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js …Run Code Online (Sandbox Code Playgroud)