小编Bor*_*ito的帖子

使用 TouchableOpacity 而不是 TouchableWithoutFeedback 时样式会中断

这是使用 TouchableWithoutFeedback 时这部分的外观

这是同样的事情,除了 TouchableOpacity

这部分的代码:

<TouchableWithoutFeedback>
    <View style={styles.buyCoinsItem}>
        <View style={styles.cost}>
            <Text>{no_of_coins}</Text>
        </View>
        <Text>{product.priceString}</Text>
        <View style={{height:30, flexDirection: 'row', marginTop:10}}>
            {displayDiscount && 
            <View style={styles.discountContainer}>
                <Text style={styles.whiteText}>Save {discount}</Text>
            </View>
            }
        </View>
    </View>
</TouchableWithoutFeedback>
Run Code Online (Sandbox Code Playgroud)

这里发生了什么?

react-native touchableopacity

5
推荐指数
1
解决办法
2127
查看次数

如何在JavaScript中找到数组名称的最后一个字符?

所以,如果我有一些数组,让我们称之为person1,person2,person3和person4,我有一个参数介于1和4之间的函数,我该如何选择那个特定的数组呢?

例如:

var person1 = ["Steve", "McStevey"];
var person2 = ["Mike", "McMikey"];
var person3 = ["Dave", "McDavey"];
var person4 = ["Joe", "McJoey"];
Run Code Online (Sandbox Code Playgroud)

如果我运行该功能

getPerson(3);
Run Code Online (Sandbox Code Playgroud)

并将参数传递给

function getPerson(x) {...}
Run Code Online (Sandbox Code Playgroud)

该函数用于参数来确定我正在寻找的数组是person3.

javascript arrays

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