 
 layoutPage = (layer, size) ->
 
-	split = detectHeaderFooter(layer)
+	split = pageLayout(layer)
 
 	return layer unless split.body
 

		for scroll in [layer, layer.children...]
			@_forwardScrollEvents(layer)

		# Set the background color for he created scroll component
		if layer instanceof ScrollComponent
			scroll.backgroundColor = @backgroundColor
			scroll.contentInset =
				top: @header?.height or 0
				bottom: @footer?.height or 0

		return layer


		size: size
		name: "scroll"

	height = layer.height
	scroll.propagateEvents = false

	constraints = layer.constraintValues
