                     var viewHeightSpec = heightSpec == .unspecified ? UniMeasureSpec.unspecified : UniMeasureSpec.limitSize
                     var viewSizeSpec = CGSize(width: paddedSize.width, height: remainingHeight)
                     viewSizeSpec.width = max(0, viewSizeSpec.width - viewLayoutProperties.margin.left - viewLayoutProperties.margin.right)
-                    viewSizeSpec.height = max(0, viewSizeSpec.height - viewLayoutProperties.margin.top - viewLayoutProperties.margin.bottom)
+                    viewSizeSpec.height = max(0, viewSizeSpec.height)
                     if widthSpec == .exactSize && viewLayoutProperties.width == UniLayoutProperties.stretchToParent {
                         viewSizeSpec.width = min(viewSizeSpec.width, max(viewLayoutProperties.minWidth, viewLayoutProperties.maxWidth))
                         viewWidthSpec = .exactSize

                    
                    // Obtain final size and make final adjustments per view
                    var result = UniView.obtainMeasuredSize(ofView: view, sizeSpec: viewSizeSpec, widthSpec: viewWidthSpec, heightSpec: viewHeightSpec)
                    if !adjustFrames {
                        result.width = 0
                    }
                    if let viewLayoutProperties = (view as? UniLayoutView)?.layoutProperties {
                        result.width = min(viewSizeSpec.width, max(viewLayoutProperties.minWidth, result.width))
                        result.height = min(viewSizeSpec.height, max(viewLayoutProperties.minHeight, result.height))
                        remainingWidth -= viewLayoutProperties.margin.left + viewLayoutProperties.margin.right
                    } else {
                        result.width = min(viewSizeSpec.width, result.width)
                        result.height = min(viewSizeSpec.height, result.height)
                    }
                    subviewSizes[i] = result
                    remainingWidth -= result.width
                    totalWeight -= viewLayoutProperties.weight
                }


                    // Obtain final size and make final adjustments per view
                    var result = UniView.obtainMeasuredSize(ofView: view, sizeSpec: viewSizeSpec, widthSpec: viewWidthSpec, heightSpec: viewHeightSpec)
                    result.width = min(viewSizeSpec.width, max(viewLayoutProperties.minWidth, result.width))
                    result.height = min(viewSizeSpec.height, max(viewLayoutProperties.minHeight, result.height))
                    subviewSizes[i] = CGSize(width: result.width, height: adjustFrames ? result.height : min(viewSizeSpec.height, viewLayoutProperties.minHeight))
                    remainingHeight -= result.height
                    totalWeight -= viewLayoutProperties.weight
                }
