我有一個的tableView具有:夫特如何移動的tableView backGroundView標籤
1-)第1頭
TableView Cell
2-)第2頭
Tableview Cell
3-)第3部分
(n rows that contains list of records)
我的tableView有3個 部分。在第3節我列出了記錄。當沒有記錄時,我會顯示一個標籤,顯示「沒有記錄」我的表格視圖,如下圖所示。
但我的問題是,我想移動標籤到的tableview的底部(在「+」視圖)我如何才能將這個標籤。這是我的SWIFT代碼
func setNoDataInfoIfAbsenceNotExists()
{
let noDataLabel : UILabel = UILabel()
noDataLabel.frame = CGRectMake(0, 0 , (self.tableView.bounds.width), (self.tableView.bounds.height))
noDataLabel.text = "No Records Found"
noDataLabel.textColor = UIColor.blackColor()
noDataLabel.textAlignment = .Center
self.tableView.backgroundView = noDataLabel
self.tableView.separatorStyle = .None
}
你爲什麼不使用故事板來代替,而改變約束??? –
你在「+」視圖上的含義是什麼?你的意思是使標籤子視圖的+視圖或點擊+你想移動標籤??? –
nodataLabel.frame =(+查看).frame試試這個... –