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.
How do I Change color of top bar?
-
Hi, I’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
http://i.imgur.com/ru9o49j.pngI 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.pngThank you for reading.
-
@MOd0 you can pass
title_bar_color
toView.present()
. -
@bennr01 said:
title_bar_color to View.present().
Tkanks for tell that, I became capable of change default bar_color.
i pleased.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)
-
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')
-
You need to resort to objective c to do this....
-
@lachlantula
Thanks for tell me that add subview with changing bar_color.
I learned python grammar which i didn't know until now.@JonB
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.