         }
     }
 
-    /// Bottom margin. Default is 4
+    /// Bottom margin. Default is 4, only work when snackbar is at bottom
     public dynamic var bottomMargin: CGFloat = 4 {
         didSet {
             bottomMarginConstraint?.constant = -bottomMargin
+            self.layoutIfNeeded()
+        }
+    }
+    
+    /// Top margin. Default is 4, only work when snackbar is at top
+    public dynamic var topMargin: CGFloat = 4 {
+        didSet {
+            topMarginConstraint?.constant = topMargin
             self.layoutIfNeeded()
         }
     }

            rightMarginConstraint?.constant = -rightMargin + superViewWidth
            bottomMarginConstraint?.constant = -bottomMargin
            self.layoutIfNeeded()
        }

        // Final state
        bottomMarginConstraint?.constant = -bottomMargin
        leftMarginConstraint?.constant = leftMargin
        rightMarginConstraint?.constant = -rightMargin



            // Bottom margin constraint
            bottomMarginConstraint = NSLayoutConstraint.init(item: self, attribute: .Bottom,
                    relatedBy: .Equal, toItem: superView, attribute: .Bottom, multiplier: 1, constant: -bottomMargin)
            
            // Top margin constraint
            topMarginConstraint = NSLayoutConstraint.init(item: self, attribute: .Top, relatedBy: .Equal, toItem: superView, attribute: .Top, multiplier: 1, constant: topMargin)

            // Avoid the "UIView-Encapsulated-Layout-Height" constraint conflicts
            // http://stackoverflow.com/questions/25059443/what-is-nslayoutconstraint-uiview-encapsulated-layout-height-and-how-should-i
            leftMarginConstraint?.priority = 999
            rightMarginConstraint?.priority = 999
            topMarginConstraint?.priority = 999
            bottomMarginConstraint?.priority = 999
            
            // Add constraints
            self.addConstraint(heightConstraint!)
            superView.addConstraint(leftMarginConstraint!)
            superView.addConstraint(rightMarginConstraint!)
            superView.addConstraint(bottomMarginConstraint!)
            superView.addConstraint(topMarginConstraint!)

            topMarginConstraint?.active = false
            
            // Show
            showWithAnimation()
        } else {
