Created
September 5, 2014 18:21
-
-
Save DiogoAndre/4080b2d47d2c6e70d76d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChildLayout < MK::Layout | |
def layout | |
add UIView, :logo_container do | |
add UIImageView, :logo_image | |
end | |
end | |
def logo_image_style | |
frame [[0, 0], [50, 198]] | |
image UIImage.imageNamed('logo-azul') | |
constraints do | |
center.equals(:logo_container) | |
end | |
end | |
def logo_container_style | |
background_color "#3778E1".to_color | |
frame from_bottom(size: ['100%', 50]) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainLayout < MK::Layout | |
view :events_table | |
def layout | |
root :main do | |
add events_table, :events_table | |
add LogoLayout, :logo_layout | |
end | |
end | |
def today_events_table_style | |
width'100%' | |
height '100% - 50pt' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TodayController < PM::Screen | |
title "Today" | |
def on_load | |
@layout = MainLayout.new(root: self.view) | |
@layout.events_table = events_table.view | |
@layout.build | |
end | |
def events_table | |
@events_table_screen ||= begin | |
m = EventsTable.new | |
self.addChildViewController m | |
m.parent_screen = self | |
m | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment