+## Dynamic Layout Demo
+
 ## Import Module
 ios = require 'iOSKit'
 whiteBG = new BackgroundLayer backgroundColor:"white"

	text:"1) Sloths are arboreal animals. This means that they live or spend their days mainly on trees. They only come down if it is time for them to urinate or defecate, which only happens once a week. <br> <br> 2) It was once thought that sloths spend about 15 to 20 hours a day sleeping. It was recently discovered, however, that sloths actually only sleep around 10 hours a day. <br> <br> 3) They are vulnerable to predation because they urinate and defecate at the same spot each time. There have been a lot of speculations regarding this behavior. Some says it is because it is easier for them to find one another especially on mating seasons. It was also observed that they defecate near the trunk of the tree, probably to fertilize the tree, which is their source of food. "

button.on Events.TouchEnd, ->
	sheet = new ios.Sheet actions:["Completely agree", "Totally agree"], animated:true, description:"Choose your agreement"
	sheet.actions["Completely agree"].on Events.TouchEnd, ->
		alert = new ios.Alert title:"Nice!", message:"👍"
		alert.on Events.TouchEnd, ->
			alert.destroy()
	sheet.actions["Totally agree"].on Events.TouchEnd, ->
		alert = new ios.Alert title:"Sweet!", message:"🙌"
		alert.on Events.TouchEnd, ->
			alert.destroy()

		
scroll.constraints =
	top:status
	bottom:button

scroll.content.addSubLayer(h1)
scroll.content.addSubLayer(slothImage)


button = new ios.Button 
	constraints:
		bottom:10 # This fixes the button to 10 pts from the bottom
	buttonType:"big"
	text:"I agree, sloths are cool"
	
