How to change foreground color in kivymd's MdTextField?

2.7k views Asked by At
from kivymd.app import MDApp
from kivymd.uix.boxlayout import BoxLayout
from kivymd.uix.textfield import MDTextField

class Mywidget(BoxLayout):
       pass
class Myapp(MdApp):
       def build(self):
             return Mywidget()
Myapp().run()

Kv file:-->myapp.kv

<Mywidget>
     orientation:"horizontal"
     MDTextField:
          halign:"center"
          valign:"center"
          hint_text:"Enter your name"
          foreground_color:1,1,0,1

But textfield's foreground color not change.How can I change it.I checked it's solution on internet but nothing happen.

2

There are 2 answers

0
Xyanight On
0
Haw On
MDTextField:
    text_color_normal: 1,0,1,1

You may also want to change 'text_color_focus'.