I am trying to create a table without using tableview because tableview doesn't cant help me, so I created a scrollview with a view inside that view is the row, but I am having trouble with view I can't create more than one row.
view.py
import ui
d=ui.load_view()
def g(text,no):
sv=d['scrollview1']
v=sv['view1']
l=v['label1']
b=v['button1']
l.text=l.background_color=b.background_color=text
v.add_subview(l)
v.add_subview(b)
v.frame.y=no*(l.frame.height+5)
sv.add_subview(v)
for ss,s in enumerate(['red','green'],1):
g(s,ss)
d.present()
view.pyui
[
{
"class" : "View",
"attributes" : {
"background_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)",
"tint_color" : "RGBA(0.000000,0.478000,1.000000,1.000000)",
"enabled" : true,
"border_color" : "RGBA(0.000000,0.000000,0.000000,1.000000)",
"flex" : ""
},
"frame" : "{{0, 0}, {240, 240}}",
"selected" : false,
"nodes" : [
{
"class" : "ScrollView",
"attributes" : {
"class" : "ScrollView",
"name" : "scrollview1",
"frame" : "{{-40, -40}, {320, 320}}",
"uuid" : "41AD7B2A-B5ED-4C74-BA2B-24469DA90229",
"content_width" : 228,
"content_height" : 320
},
"frame" : "{{6, 19}, {228, 182}}",
"selected" : true,
"nodes" : [
{
"class" : "View",
"attributes" : {
"class" : "View",
"name" : "view1",
"uuid" : "03D06CC2-E81C-4D70-B02E-6894CE5EB352",
"frame" : "{{64, 110}, {100, 100}}",
"background_color" : "RGBA(0.800000,1.000000,0.800000,1.000000)"
},
"frame" : "{{0, 0}, {228, 74}}",
"selected" : true,
"nodes" : [
{
"class" : "Label",
"attributes" : {
"font_size" : 18,
"text" : "Label",
"font_name" : "<System>",
"name" : "label1",
"class" : "Label",
"alignment" : "left",
"frame" : "{{39, 21}, {150, 32}}",
"uuid" : "6DFB1E3F-0AE3-4AAA-BDE7-1A33E95AE96A"
},
"frame" : "{{6, 22}, {150, 32}}",
"selected" : true,
"nodes" : [
]
},
{
"class" : "Button",
"attributes" : {
"font_size" : 15,
"title" : "",
"name" : "button1",
"corner_radius" : 0,
"border_color" : "RGBA(0.700000,1.000000,0.550000,1.000000)",
"border_width" : 1,
"class" : "Button",
"frame" : "{{74, 21}, {80, 32}}",
"image_name" : "iob:ios7_play_outline_256",
"uuid" : "4D57F024-937D-435D-9099-064D8D644514"
},
"frame" : "{{174, 13}, {48, 55}}",
"selected" : false,
"nodes" : [
]
}
]
}
]
}
]
}
]