我正在尝试创建一个新分数(分数只是1到10之间的整数值)。我一直在阅读http://guides.rubyonrails.org/form_helpers.html寻求帮助,我想用单选按钮来做这件事。我虽然做得不对。我无法弄清楚如何将新得分与所选的正确值相关联。见下文
np.sum(np.sum(arr, axis=1), axis=1) # Nested sums
arr.sum(axis=2).sum(axis=1) # identical but more "sequential" than "nested"
值是分数表中字段的名称
答案 0 :(得分:0)
尝试
let test:UIView = UIView(frame: CGRectMake(0, 0, 100, 100))
test.backgroundColor = UIColor.blackColor()
self.view.addSubview(test)
test.translatesAutoresizingMaskIntoConstraints = false
let topCKCtr = NSLayoutConstraint(item: test, attribute: .CenterX, relatedBy: .Equal, toItem: test.superview, attribute: .CenterX, multiplier: 0.5, constant: 0)
topCKCtr.active = true
let topCKCtr1 = NSLayoutConstraint(item: test, attribute: .CenterY, relatedBy: .Equal, toItem: test.superview, attribute: .CenterY, multiplier: 0.5, constant: 0)
topCKCtr1.active = true
self.view.layoutIfNeeded()
self.view.setNeedsDisplay()