我有一個if語句在我的應用程序,我想它改變靜態的tableview單元格的高度。這是我期望的更改靜態表視圖單元格高度
import UIKit
class DashboardViewController: UITableViewController {
@IBOutlet weak var cell: UITableViewCell!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
// Set cell to "show" on date
let date = Date()
let calendar = Calendar.current
let components = calendar.dateComponents([.year, .month, .day], from: date)
let year = components.year
let month = components.month
let day = components.day
if(month == 6 && day == 5 && year == 2017) {
// Here I want the height to be set to 313
} else {
// Here I want the height to be set to 0
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
我需要幫助的行標記。謝謝!
您是否嘗試過增加高度限制在電池上,改變你的病情是不變的? –
@AndrezaCristinadaSilva我似乎無法爲單元格添加高度限制 – iFunnyVlogger