简体   繁体   中英

Using constrain for inputView of a UITextField

I have a UITextField and I added inputview to it

 [textField setInputView:inputView];

I added some buttons along with date picker in input view. Input view has UIDatePicker as subview. Since the inputview is not added as subview to any other view, I cannot set height constrain for inputView. How to deal with constrain for inputview of a UITextField .

I think you not need to set constraint for input view. because it is take default place of keyboard .

You should show date picker as input view and you should take toolbar as inputaccessory view of textfield and add buttons to that tool bar ,so you not need to manage layout and it is the standard way also.

Hope this will help :)

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