Skip to content

Instantly share code, notes, and snippets.

@DiogoAndre
Created September 5, 2014 18:21
Show Gist options
  • Save DiogoAndre/4080b2d47d2c6e70d76d to your computer and use it in GitHub Desktop.
Save DiogoAndre/4080b2d47d2c6e70d76d to your computer and use it in GitHub Desktop.
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
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
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