我希望在android react native应用程序中更改文本Color&placeholder textcolor:
render: function() {
return (
<View>
<TextInput
placeholder='Add Credit'
placeholderTextColor='ffffff'
textAlign='center'
/>
</View>
);
},
var styles = StyleSheet.create({
creditInput: {
backgroundColor: "#3f51b5",
color: "#ffffff", //Expecting this to change input text color
},
Run Code Online (Sandbox Code Playgroud)
(参考:https://facebook.github.io/react-native/docs/textinput.html#content)
placeholderTextColor并按backgroundColor预期更改,但不是输入文本颜色.我使用了错误的属性,还是这是一个本机/机器人的反应错误?
这个问题以前问这里:Threejs:分配不同的颜色,以几何每个顶点,但它是很老,所以提供的解决方案不three.js所的当前版本(不再提供属性工作vertexColors为几何类).
我知道可以设置几何体的每个面的颜色,但是我将球体的顶点设置为不同的距离,并且我希望同时调整每个顶点的颜色,这取决于它与中心的距离.
我想要一种方法来减少列(信用)中的每个值一定的数量.我试过了:
User.all.map! {|user| user.credit -= 50}
Run Code Online (Sandbox Code Playgroud)
它只是映射信用,而不是用户.我觉得正确的答案是使用
User.update_all(something)
Run Code Online (Sandbox Code Playgroud)
但我不知道如何使用此方法更新相对于其先前值的值.
这似乎是一个常见的要求,所以我猜测有一个标准的方法.