I’m trying to fill a tableView with rows one after the other with a slight delay between each cell appearing.
This is how I’m trying to do it - but they all still appear in one go:
def tableview_cell_for_row(tableview, section, row): cell =ui.TableViewCell("subtitle") data = tableview.data_source.items[row] cell.bg_color = (0,1,0,0.1) cell.text_label.font= ('system',(17*Hmult)) cell.text_label.text_color = (0,1,0,0.0) cell.text_label.text = str(data) selected_cell = ui.View() selected_cell.bg_color = (0,1,0,0.2) selected_cell.text_color = (0,1,0,1.0) cell.selected_background_view = selected_cell def anim(): if len(tableview.data_source.items) != row: print(row) cell.text_label.text_color = (0,1,0,0.5) ui.delay(anim,0.2) ui.delay(anim,0.2) return cell
Hi what is the secret to getting a table view from ui designer to overlay onto a background such that only the text is visible and the cells have no background?
I have tried setting bg_color of data source and/or table view to none but it’s not happening.ie each cell is always white.
I can remove white separator lines using tableView.separator_color=(1,0,0,0).
Why won’t the same work for .bg_color and/or .background_color (and what is the difference between those two anyhow?)
Thanks in advance for any help :)
What am I missing here?
That’s great thanks for explaining !
Im a little confused about a couple of things:
Why do I need to redeclare the bgLines view?
bgv=bgLines(flex='wh') bgv.alpha=.2 bgv.tint_color='red' bgv.update_interval=.1
In my case I have made a pyui file that contains the bgLines custom view but pushed to the back.
So is it necessary to subView the buttons/bgLines ? or. Or is there an arrangement of subviews in the UI editor that would get all this working?
I have it working your way but if I am able to reduce any further editing of views etc outside of the UI designer that would be ideal.
If not no probs - just trying to understand the inheritance of the views via the designer.
Ie isn’t the blank canvas of the designer effectively the root ? So if I add a custom view push it to the back and then add a button etc isn’t this the same as :
Thanks again for your help!
Ok my original post was a bit of a wacky scene/ui mutation - say I have this code below and want it to play in the bg of a UI that I have constructed using UI designer:
class bgLines(ui.View): def __init__(self): self.w = ui.get_screen_size() self.h = ui.get_screen_size() self.lines= for v in range(0,random.randint(10,int(self.h/4))): self.lines.append(ui.Path.rect ((self.w/2),random.uniform(0,int(self.h)),self.w,random.uniform(1,10))) ui.set_color('green') self.lines[v].stroke()
How do I layer the UI elements to correctly reveal the bg undearneath?
I have set their alphas to 0.5 but I’m not seeing the bgLines view underneath.
Do I need to subview the elements that are on top to the bgLines view?
Any help appreciated