简体   繁体   中英

How to increase the MDCTextField border width and make the corners more rounded?

I followed the https://material.io/design/components/text-fields.html#text-fields-single-line-text-field and have made the MDCTextField with MDCTextInputControllerOutlined controller and it works fine as shown in image.

Now I need to increase the width of the border and also make the corner more rounded.

I found this issue as listed below: https://github.com/material-components/material-components-ios/issues/4173

It says :

" That is the current behavior of OutlinedTextFields. It will automatically set the lineWidth to 2.0 while editing. you can find this in updateBorder implementation in MDCTextInputControllerOutlined."

So if we use MDCTextInputControllerOutlined can't we change the width of our textfield border?

Here is the code

@IBOutlet weak var txtFieldUserName: MDCTextField!
var userNameTextFieldController: MDCTextInputControllerOutlined?

userNameTextFieldController = MDCTextInputControllerOutlined(textInput: txtFieldUserName)

在此处输入图片说明

将此类MDCTextField替换为MMTextField https://gist.github.com/macchamps/8af7a8f8dc567ec16ad785b303bd90f6

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM