Kivy MD MDTextField

28 views
Skip to first unread message

Sadaka Technology

unread,
Oct 9, 2020, 3:14:45 PM10/9/20
to Kivy users support
Hi everyone, I am having a trouble in kivymd which is when I use MDTextField in kv file , it is working perfectly which means hint_text all are working all are perfect in kv file,
but if I specify them on python file like:

widget = MDTextField(hint_text='dwafaw',font_size=14)

self.add_widget(widget)

then the text_hint will never be shown, same goes for other properties like helper text,

I cannot go to kv file due to functionality issues (lots of complex functions and variables) and I tried to reference a class like
 class text_class(MDTextField)
then apply on kv file then reference it to python file, yet not working! any suggestions, something must be there with kivymd file!!

Elliot Garbus

unread,
Oct 9, 2020, 3:38:23 PM10/9/20
to kivy-...@googlegroups.com

I don’t know if this will help, but it is something to try.. 

w = MDTextField(font_size=14)

w.hint_text = ‘The hint text’

 

self.add_widget(w)

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/03067b3d-5c0c-46e7-941c-1bfe6dd5abbdn%40googlegroups.com.

 

Sadaka Technology

unread,
Oct 9, 2020, 4:12:22 PM10/9/20
to Kivy users support
yes this worked ! thank you alot, but 1 more thing, I set the font_size to be 14, so the textinput size is 14, but hint_text is bigger, any idea of how to adjust hint_text size?

Elliot Garbus

unread,
Oct 9, 2020, 4:14:54 PM10/9/20
to kivy-...@googlegroups.com

I have not used kivymd. I suggest reading the docs or the source code and see if you can find an attribute that controls the size of the hint_text.

Reply all
Reply to author
Forward
0 new messages