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.
Change disclosure_indicator color in TableViewCell
-
Hello,I want to make a dark mode for my view. But how can I change the disclosure_indicator color in TableViewCell? Thank you!
-
@mieq you could use ObjectiveC AccessoryView instead of default AccessoryType, like quick and dirty shown here
import ui from objc_util import * class source (object): def tableview_number_of_rows(self, tv, s): return 4 def tableview_cell_for_row(self, tv, s, r): type = {0:'default', 1:'subtitle', 2:'value1', 3:'value2'}[r] cell = ui.TableViewCell(type) if r == 0: print(dir(ObjCInstance(cell))) v = ui.Button() v.background_color = 'red' v.frame = (0,0,32,32) v.title = '>' vo = ObjCInstance(v) ObjCInstance(cell).setAccessoryView_(vo) cell.text_label.text = 'Title' try: cell.detail_text_label.text = 'Detail' except AttributeError: pass try: cell.image_view.image = ui.Image.named('ionicons-image-32') except AttributeError: pass return cell view = ui.TableView() view.data_source = source() view.present()
-
@mieq or
#v.background_color = 'red' v.tint_color = 'red'
-
@cvp perfect! In fact, I found out how to implement it with Objc by Google, but I don't know how to convert it to Python. and your code is a great example for me to learn. Thanks a lot!