                 
                 if isLeftMarginGap {
                     canonicalMarginGap = keyGapName
-                    allConstraints += "[leftSpacer][\(keyGapName)]"
+                    let width = (isEquallySpacedRow ? "(0)" : "") // equally spaced row has no side margins
+                    allConstraints += "[leftSpacer][\(keyGapName)\(width)]"
                 }
                 else if isRightMarginGap {
                     allConstraints += "[key\(j-1)x\(i)][\(keyGapName)(\(canonicalMarginGap))][rightSpacer]"

    }
    
    // TODO: make this a single constraint string??
    func createKeyGapConstraints(keyboard: Keyboard) {
        var allConstraints: Array<String> = []
        
        var canonicalMarginGap: String? = nil
        
        for i in 0..<keyboard.rows.count {
            for j in 0...keyboard.rows[i].count {
                let keyGapName = "keyGap\(j)x\(i)"
                let keyGap = self.elements[keyGapName]

                else {
                    allConstraints += "[key\(j-1)x\(i)][\(keyGapName)]" // QQQ: this is where the gap width was
                    
                    // the width is determined as a percentage of the total container size,
                    // as long as we're not on an equally spaced row
                    if !canonicalKeyGap {
                        if !isEquallySpacedRow {
                            self.view.addConstraint(NSLayoutConstraint(
                                item: keyGap,
                                attribute: NSLayoutAttribute.Width,
                                relatedBy: NSLayoutRelation.Equal,
                                toItem: self.view,
                                attribute: NSLayoutAttribute.Width,
                                multiplier: 5/320.0,
                                constant: 0))
                        }
                        canonicalKeyGap = keyGapName
                    }
                    else {
                        allConstraints += "[\(keyGapName)(\(canonicalKeyGap))]"
                    }
                }
                
                // each gap has the same height
