使用swift 3x以编程方式隐藏占位符

时间:2017-01-02 05:39:20

标签: swift xcode swift3 uitextfield placeholder

如何使用Swift 3x以编程方式隐藏TextField的占位符?

1 个答案:

答案 0 :(得分:1)

您无法隐藏UITextField的{​​{1}},但可以将其设置为空字符串。

self.textField.placeholder = ""

如果您希望显示textField只需使用您想要的字符串设置placeholder,则placeholder以后不会显示任何self.textField.placeholder = "Enter name"

import MySQLdb
import sys

connection = MySQLdb.connect (host="localhost", user = "", passwd = "", db =    
"")
cursor = connection.cursor ()
cursor.execute ("select * from tablename")
data = cursor.fetchall ()
OutputFile = open("C:\Temp\Test.txt", "w")

for row in data :
   print>>OutputFile, row[0],row[1],row[2],row[3],row[4],row[5],row[6]

OutputFile.close()
cursor.close ()
connection.close ()
sys.exit()