def setup_bottom_menu(self, buttons):
bottom_menu_height = 40
(_, _, w, h) = self.bg.bounds
bottom_menu = EvenView(margin = 20)
bottom_menu.flex = 'WT'
bottom_menu.frame = (0, h - bottom_menu_height, w, bottom_menu_height)
bottom_menu.background_color = 'white'
self.bg.add_subview(bottom_menu)
for icon, func in buttons:
button = ui.Button(image = ui.Image.named(icon))
button.action = func
button.name = func.__name__
button.tint_color = self.menu_color
bottom_menu.add_subview(button)
return bottom_menu
评论列表
文章目录