静的なテーブルビューのセルの高さを変更したいアプリケーションにifステートメントがあります。ここに私が望んでいるものがありますスタティックテーブルビューのセルの高さを変更する
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