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
-
@cvp said:
@DavinE said:
But i don't set one it's weird
Try
self.table_view.content_inset = (0,-50,50,0) # left + bottom
I've had the same Idea :D
i set it to -25 because the underline for the rows moves too
-
@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 ?
-
@cvp said:
@DavinE never mind, I did forget that if you remove the edited=True the problem disappeared
yeah right :D
-
@DavinE ok, if content_inset solves it, let us forget and sorry
-
@cvp said:
@DavinE ok, if content_inset solves it, let us forget and sorry
hehe no Problem i thank you again @cvp
-
last edited by moezop
-
Yes but if you don't use cell.image, you can hide this left blank area by
tableview.content_inset = (0,-80,50,0) # left + bottom