答案 0 :(得分:11)
您应该使用 returnKeyType 属性来确定返回键的外观
示例:
<TextInput style={{height:40}}
placeholder="Input"
placeholderTextColor="#DCDCDC"
returnKeyType="Go"
/>
答案 1 :(得分:0)
更新2019:使用版本import Foundation
enum ArithmeticExpression {
case number(Int)
indirect case addition(ArithmeticExpression, ArithmeticExpression)
indirect case multiplication(ArithmeticExpression, ArithmeticExpression)
}
var a = readLine()!.split(separator: " ").map{Int(String($0))!}
var nums = [a]
let x = ArithmeticExpression.number(nums[1])
let y = ArithmeticExpression.number(nums[1])
let sum = ArithmeticExpression.addition(x, y)
let product = ArithmeticExpression.multiplication(sum,
ArithmeticExpression.number(2))
func evaluate(_ expression: ArithmeticExpression) -> Int {
switch expression {
case let .number(value):
return value
case let .addition(left, right):
return evaluate(left) + evaluate(right)
case let .multiplication(left, right):
return evaluate(left) * evaluate(right)
}
}
时,已接受的答案不再有效,因为“ Go”不是可接受的值之一,请改用“ go”而不使用大写字母
实际的react-native 0.57
合同规定了以下枚举:
react-native 0.57