material-components-ios
material-components-ios copied to clipboard
How to decrease the MDCTextField height
For usage questions: ask on Stack Overflow.
A clear and concise description of what the bug is.
Reproduction steps
Steps to reproduce the behavior:
i have installed pod 'MaterialComponents/TextFields' pod in my project
and i have added textfield in my storyboard with height 30 and i have added this code in my swift file
import MaterialComponents
class PageContentViewController: UIViewController {
@IBOutlet weak var serviceTitleTextField: MDCTextField!
private var titleTextfieldeController: MDCTextInputControllerOutlined?
override func viewDidLoad() {
super.viewDidLoad()
titleTextfieldeController = MDCTextInputControllerOutlined(textInput: serviceTitleTextField)
titleTextfieldeController?.floatingPlaceholderActiveColor = .darkGray
}
so here i am getting big height for textfield in output
I want 30 height textfield.. how.. please do help

- Go to '...'
- Tap on '....'
Expected behavior
A clear and concise description of what you expected to happen.
Actual behavior
A clear and concise description of what actually happened. Include screenshots or gifs where possible.
Platform (please complete the following information)
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
Additional context
Add any other context about the problem here.
Try with preferredContainerHeight or verticalDensity.
Try with
preferredContainerHeightorverticalDensity.
how to use preferredContainerHeight or verticalDensity.
could you explain
preferredContainerHeight and verticalDensity are properties on TextControls text fields, not MDCTextField. To use those properties you'd need to use this component:
https://github.com/material-components/material-components-ios/tree/develop/components/TextControls
As opposed to this one:
https://github.com/material-components/material-components-ios/tree/develop/components/TextFields