Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
TableView content_size Problem
-
Hey guys,
i have a weird problem with an TableView....
when my view on an iPhone or iPad is "full" i need scrolling to see more of my stuff but the last row of my TableView is always out of my View..
when I want to see the last row and scroll down and as soon as I let go it pops out of view again but i don't know why...
did i already a mistake... :(self.table_view = ui.TableView() self.table_view.data_source = self self.table_view.delegate = self self.table_view.flex = 'WH' self.table_view.allows_selection_during_editing = True self.table_view.tint_color = 'grey' dock(self.table_view).top_left(self.view) at(self.table_view).top = at(self.adaptSpecificCustomer).bottom
EDIT:
On this pic:
https://imgur.com/a/sejyonX
Is in the left side free Space How can i Remove this ?This is a Video to explain my issue at the Main Topic
https://imgur.com/a/g9tnWOe -
@DavinE do you use tableview_cell_for_row and content_inset?
Do you set a cell type like in ui.TableViewCell(type)? -
@cvp said:
@DavinE do you use tableview_cell_for_row and content_inset?
I'm using tableview_cell_for_row but not content_inset
@cvp said:
Do you set a cell type like in ui.TableViewCell(type)?
No, i only use ui.TableViewCell() not a special Type
@DavinE said:
On this pic:
https://imgur.com/a/sejyonX
Is in the left side free Space How can i Remove this ?I know where this Problem comes from but not how to solve it....
when i removeediting = True
it is goneThis is because i don't set
tableview_can_delete
to true... when i do this:
https://imgur.com/a/HB45cr3
but i don't need this -
@DavinE said:
I know where this Problem comes from but not how to solve it....
when i remove editing = True it is goneWhy do you need it?
-
@cvp, for moving rows
-
@DavinE try, for the other problem
self.table_view.content_inset = (0,0,50,0) # bottom
-
@DavinE said:
I'm using tableview_cell_for_row
Normally, the left area is reserved for cell.image, like cell.label_text for the text
-
-
-
-
@DavinE said:
But i don't set one it's weird
Try
self.table_view.content_inset = (0,-50,50,0) # left + bottom
-
-
@DavinE agree this is only a workaround. Must be a setting to avoid this
-
@DavinE could you post you tableview_cell_for_row
-
@cvp
This is the tableview_cell_for_row from file-picker.py
with this i'm workingdef tableview_cell_for_row(self, tv, section, row): cell = ui.TableViewCell() entry = self.flat_entries[row] level = entry.level - 1 image_view = ui.ImageView(frame=(44 + 20*level, 5, 34, 34)) label_x = 44+34+8+20*level label_w = cell.content_view.bounds.w - label_x - 8 if entry.subtitle: label_frame = (label_x, 0, label_w, 26) sub_label = ui.Label(frame=(label_x, 26, label_w, 14)) sub_label.text = entry.subtitle sub_label.text_color = '#999' cell.content_view.add_subview(sub_label) else: label_frame = (label_x, 0, label_w, 44) label = ui.Label(frame=label_frame) label.text = entry.title label.flex = 'W' cell.content_view.add_subview(label) if entry.leaf and not entry.enabled: label.text_color = '#999' cell.content_view.add_subview(image_view) if not entry.leaf: has_children = entry.expanded if not appex.is_running_extension(): btn = ui.Button(image=ui.Image.named('CollapseFolder' if has_children else 'ExpandFolder')) else: btn = ui.Button(image=ui.Image.named('iob:arrow_down_b_24' if has_children else 'iob:arrow_right_b_24')) btn.frame = (20*level, 0, 44, 44) btn.action = self.expand_dir_action cell.content_view.add_subview(btn) if entry.icon_name: image_view.image = ui.Image.named(entry.icon_name) else: image_view.image = None return cell
-
@DavinE said:
On this pic:
https://imgur.com/a/sejyonX
Is in the left side free Space How can i Remove this ?You have to show the first row of your TableView to be sure
Same File_Picker without this left space
-
@cvp I don't know exactly what you want from me :( sorry
-
@DavinE never mind, I did forget that if you remove the editing=True the problem disappeared
-
@cvp said:
@DavinE said:
On this pic:
https://imgur.com/a/sejyonX
Is in the left side free Space How can i Remove this ?You have to show the first row of your TableView to be sure
Same File_Picker without this left space
yes, but without moving rows...
when you addediting = True
i think it's the same issue or ? -