简体   繁体   English

如何将文本值预加载到 SkyFloatingLabelTextField

[英]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.

相关问题 如何在 SkyFloatingLabelTextField 中垂直和水平对齐文本? - How to vertically and horizontally align text in SkyFloatingLabelTextField? 如何使用SkyFloatingLabelTextField快速验证textField - How to validate textField in swift using SkyFloatingLabelTextField 将 UIImageView 添加为 textfield 的 rightView 与 skyfloatinglabeltextfield 的文本垂直对齐 - Vertically align UIImageView added as rightView of textfield with the text of skyfloatinglabeltextfield 如何使用 XCUITest 在 SkyFloatingLabelTextField 中获取浮动标题的内容? - How to get the content of floating title in SkyFloatingLabelTextField using XCUITest? SkyFloatingLabelTextField 在焦点上自动向上移动标签 - SkyFloatingLabelTextField auto move label up on focus 在移至另一个VC之前如何预加载数据 - How to preload data before moving to another VC 如何在Swift中预加载横幅广告? - How do you preload banner iAds in Swift? 如何在推送其视图控制器之前预加载 WKWebView? - How to preload WKWebView before pushing its viewcontroller? 预加载还是不预加载? - Preload or not preload? 如何在 Swift 5 中将电子表格数据预加载到 Core Data? - How to preload spreadsheet data to Core Data in Swift 5?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM