def __init__(self):
# Init
self.views = []
self.curview = None
self.root = ui.View(name="Multipanel")
self.close = ui.Button()
self.close.name = "close"
self.close.enabled = False
self.close.image = ui.Image.named("ionicons-close-round-32")
self.close.action = self.close_tapped
self.root.add_subview(self.close)
self.close.frame = self.root.width - 32, 0, 32, 32
self.close.flex = "LB"
self.tabs = ui.SegmentedControl()
self.tabs.name = "tabs"
self.tabs.enabled = False
self.tabs.selected_index = -1
self.tabs.segments = [PLACEHOLDER_TEXT]
self.tabs.action = self.segment_changed
self.root.add_subview(self.tabs)
self.tabs.frame = 0, 0, self.root.width - self.close.width, self.tabs.height
self.tabs.flex = "WB"
self.placeholder = ui.View()
self.placeholder.background_color = "lightgray"
self.ph_label = ui.Label()
self.ph_label.font = ("<system-bold>", 24)
self.ph_label.text_color = "gray"
self.ph_label.text = "No View Selected"
self.placeholder.add_subview(self.ph_label)
self.ph_label.size_to_fit()
self.ph_label.center = self.placeholder.center
self.ph_label.flex = "TBLR"
self.update_view()
评论列表
文章目录