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.
Dark keyboard for ui.textfield/TextView
-
Sorry if I'm missing something, but is this possible? If not, it should be.
-
If not, it should be.
Agreed. For now:
import ui from objc_util import ObjCInstance, on_main_thread @on_main_thread def set_kb_apperance(view, appearance='dark'): a = 1 if appearance == 'dark' else 0 if isinstance(view, ui.TextView): ObjCInstance(tv).setKeyboardAppearance_(a) elif isinstance(view, ui.TextField): ObjCInstance(view).subviews()[0].setKeyboardAppearance_(a) else: raise TypeError('Expected ui.TextView or ui.TextField')
-
@omz As a follow up, I can't find a way to set the color of the background of a TextField either. The
background_color
attribute seems to affect the tiny areas behind the rounded corners, but leaves the text entry a glaring white. If you're wondering why I'm asking these questions, I'm trying to bulild a dark-looking UI and having problems. -
@Webmaster4o You can set the
bordered
attribute toFalse
to make thebackground_color
have an effect. You can then useborder_width
,border_color
andcorner_radius
to emulate the default (rounded rect) style.Alternatively, you could put a view behind the text field for the background – you might want to do this to customize the padding.
-
Thanks a lot, works like a charm ;)