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().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_colorattribute 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
Falseto make the
background_colorhave an effect. You can then use
corner_radiusto 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 ;)