[英]How to preload text value into SkyFloatingLabelTextField
I am currently using SkyFloatingLabelTextField and have the following code.我目前正在使用 SkyFloatingLabelTextField 并具有以下代码。
var textFieldLastNameSignUp: SkyFloatingLabelTextField!
textFieldLastNameSignUp.placeholder = "Family Name"
textFieldLastNameSignUp.title = "Last Name"
Based on this it shows a single line in the app loaded with 'Family Name'.基于此,它在加载有“姓氏”的应用程序中显示一行。 The moment I click into the field, the 'Family Name' text goes away and the title 'Last Name' shows above the entry.
当我单击该字段时,“姓氏”文本消失,标题“姓氏”显示在条目上方。
I would like to show both 'Family Name' in the entry line and 'Last Name' in the title at the same time.我想同时在输入行中显示“姓氏”和标题中的“姓氏”。 How do I accomplish that?
我该如何做到这一点?
These two things did the magic.这两件事起到了神奇的作用。
This forced the title to be visible textFieldLastNameSignUp.setTitleVisible(true)这迫使标题可见 textFieldLastNameSignUp.setTitleVisible(true)
This forced the text box to accept the text textFieldLastNameSignUp.insertText(self.userLastName)这迫使文本框接受文本 textFieldLastNameSignUp.insertText(self.userLastName)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.