Closed jhay06 closed 1 year ago
What type of text field exactly are you asking for?
rectangle or round
Hello Jhay06, You can create that radius effect or apply it by combining a few specific details, in canvas instructions, refer to the code below:
For radius dp(15):
For radius dp(9):
You have to add a rounded rectangle with a line that fits in the rectangle:
Kivy Lang class:
`Screen: NavigationLayout: id: jbsidis ScreenManager: id: J Screen: name: "home"
FloatLayout:
id: real_
BoxLayout:
id: f1top
pos_hint: {"center_x": .5, "center_y": 1.38}
padding: dp(15)
canvas.before:
Color:
rgba: [0.1,0.5,0.7,1]
Rectangle:
pos: self.pos[0],self.pos[1]+dp(35)
size: self.size[0]+dp(10), dp(50)
canvas.after:
Color:
rgba: [0,0,0,.3]
Line:
width: dp(1)
rectangle:
(self.x, self.y+dp(34), self.width+dp(15), dp(0))
BoxLayout:
FloatLayout:
size_hint: .1,None
BoxLayout:
id: coe
pos_hint: {"center_x": .45, "center_y": .80}
padding: dp(10),dp(-5)
size_hint: .3, None
orientation: "vertical"
#White rectangle in search field
canvas.before:
Color:
rgba: [1,1,1,1]
RoundedRectangle:
pos: self.pos[0]-dp(50),self.pos[1]-dp(4)
size: self.width+dp(90), dp(29)
radius: [dp(9),dp(9),dp(9),dp(9)]
#red rectangular
canvas.after:
Color:
rgba: [0.1,0.1,0.9,1] #[0.1921,0.1921,0.2078,1]
Line:
width: dp(1)
rounded_rectangle:
(self.x-dp(50), self.y-dp(4), self.width+dp(90), dp(29),\
dp(9),dp(9),dp(9),dp(9),\
dp(50))
MDIconButton:
icon: "magnify"
ripple_scale: .1
#user_font_size: "17sp"
theme_text_color: "Custom"
text_color: [0,0,0,.6]
md_bg_color: [0,0,0,0]
pos_hint: {"center_x": .275, "center_y": .38}
on_release:
root.ids.rs23.focus=True
BoxLayout:
id: co
pos_hint: {"center_x": .37, "center_y": .68}
padding: dp(10),dp(-5)
size_hint: .15, None
orientation: "horizontal"
MDTextFieldx:
id: rs23
fill_color: 0, 0, 0, 1
line_color_normal: 0,0,0,1
line_color_focus: 0,0,0,1
size_hint: None, None
markup: True
hint_text: " JBSIDIS"
on_text:
self.b12(self.text)
FloatLayout:
id: wel7
MDIconButton:
size_hint: .36,.3
ripple_scale: .1
no_ripple_effect: True
pos_hint: {"center_x": .46, "center_y": 6.75}
icon: "a.png"
on_release: root.ids.rs23.focus=True
isn't it too long ? hoping that we can set radius in default mdtextfield without customizing code
Hi , would like to ask how can i achieve to set a custom radius in mdtextfield , from documentation there's no available properties where i can set the corner radius ,
Thanks Regards