How do I Change color of top bar?
MOD0 last edited by
Hi, Ｉ’ve recently started pythonista for iOS.
And I don't know how i change color of top bar.
I don't know its bar name exact, so i decided to ask here.
Please look at the image
I mean I want to change color that space(bar?) , can i do that?
or Please help me on how to full space when ran myself gui program.
like this example game program. http://i.imgur.com/lNExnah.png
Thank you for reading.
bennr01 last edited by
@MOd0 you can pass
MOD0 last edited by
title_bar_color to View.present().
Tkanks for tell that, I became capable of change default bar_color.
but, how can i change "title_bar_color" when running program like when change "background_color" ,(for example label,button,,,).
for example i want change "title_bar_color" like that
- red (when start progrum)
- blue ( when "button1 = sender.superview['button1']" pushed)
- green ( when "button2 = sender.superview['button2']" pushed)
lachlantula last edited by
This works decently.
import time, ui class Interface(): @ui.in_background def Switch(sender): if Interface.bgcolour == 'red': Interface.bgcolour = 'blue' Interface.btn.title = 'Red!' else: Interface.bgcolour = 'red' Interface.btn.title = 'Blue!' Interface.v.close() time.sleep(1) Interface.v.background_color = Interface.bgcolour Interface.v.present('sheet', title_bar_color = Interface.bgcolour) btn = ui.Button() btn.title = 'Blue!' btn.x = 0 btn.y = 0 btn.width = 300 btn.height = 300 btn.action = Switch bgcolour = 'red' v = ui.View(background_color = bgcolour) v.add_subview(btn) v.width = 300 v.height = 300 x = Interface() x.v.present('sheet', title_bar_color = 'red')
JonB last edited by
You need to resort to objective c to do this....
MOD0 last edited by ccc
Thanks for tell me that add subview with changing bar_color.
I learned python grammar which i didn't know until now.
Thanks for tell me the :URL.
I achieve my objective that changing bar_color when running program without change or add subview.
for everyone who answered my asking
Thank you for answering my question, and
I thank you for reading it through.
By now, I guess you get used to my funny English writing.