我使用listview作为触发器将数据放入文本框。但是我希望将访问数据库中的Firstname,lastname和middle initial直接显示到文本框中。我将代码显示在文本框中的代码。
let bookmark = NSURL(string: "http://www.apple.com")!
let safari = SFSafariViewController(url: bookmark as URL)
present(safari, animated: true, completion: nil)
//...
func safariViewControllerDidFinish(controller: SFSafariViewController) {
controller.dismiss(animated: true, completion: nil)
}
将我的访问数据库连接到我的列表视图。
If Not ListView1.SelectedItems.Count = 0 Then
txtqrCode.Text = ListView1.Items(ListView1.SelectedIndices(0)).Text
cbCategory.Text = ListView1.Items(ListView1.SelectedIndices(0)).SubItems(1).Text
Dim str As String = ListView1.Items(ListView1.SelectedIndices(0)).SubItems(2).Text
Dim splitStr As String() = str.Split(","c)
txtLastName.Text = splitStr(0).Trim()
txtFirstName.Text = splitStr(1).Trim()
txtMiddleInitial.Text = splitStr(2).Trim()
cbGender.Text = ListView1.Items(ListView1.SelectedIndices(0)).SubItems(3).Text
txtAddress.Text = ListView1.Items(ListView1.SelectedIndices(0)).SubItems(4).Text
End If
End Sub
还有其他解决方案吗?什么是代码?请需要一些帮助。