          (map keys (vals relative-layout-attributes))))
 
 (deftrait :relative-layout-params
-  {:attributes all-relative-attributes
+  {:attributes (concat all-relative-attributes margin-attributes)
    :applies? (= (kw/keyword-by-classname container-type) :relative-layout)}
   [^View wdg, {:keys [layout-width layout-height
                       layout-align-with-parent-if-missing] :as attributes}


;; ### Layout parameters attributes

(deftrait :default-layout-params
  "Takes `:layout-width` and `:layout-height` attributes and sets
   LayoutParams, if the container type is not specified."

    (doseq [[attr-name attr-id] (:with-id relative-layout-attributes)]
      (when (contains? attributes attr-name)
        (.addRule lp attr-id (to-id (attr-name attributes)))))
    (apply-margins-to-layout-params lp attributes)
    (.setLayoutParams wdg lp)))

(deftrait :padding
