Class: ViewAnchoringController

Inherits:
UIViewController
  • Object
show all
Includes:
SimpleView::Layout
Defined in:
app/view_anchoring_controller.rb

Instance Method Summary collapse

Methods included from SimpleView::Layout

#add_view, #create_view, included, #setup, #view_stack

Instance Method Details

#viewDidLoadObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/view_anchoring_controller.rb', line 4

def viewDidLoad
  self.title = "View Anchoring"

  SimpleView::Styles.define :square,
    width: 20,
    height: 20

  setup view do
    rect name: 'fill', styles: :square, backgroundColor: "#000", top: 0, left: 0, bottom: 0, right: 0

    rect name: 'tl', styles: :square, backgroundColor: "#990000", top: 0, left: 0
    rect name: 'tc', styles: :square, backgroundColor: "#993300", top: 0
    rect name: 'tr', styles: :square, backgroundColor: "#CC9900", top: 0, right: 0

    rect name: 'ml', styles: :square, backgroundColor: "#006600", left: 0
    rect name: 'mc', styles: :square, backgroundColor: "#336666"
    rect name: 'mr', styles: :square, backgroundColor: "#0033FF", right: 0

    rect name: 'bl', styles: :square, backgroundColor: "#000099", bottom: 0, left: 0
    rect name: 'bc', styles: :square, backgroundColor: "#660099", bottom: 0
    rect name: 'br', styles: :square, backgroundColor: "#990066", bottom: 0, right: 0
  end
end