1
コンテンツを持つセルで終了するタイムラインビューを持つテーブルビューコントローラを作成しました。 テーブルビューの縦線は、配列から2つのリストを引っ張っているので、tableviewの2番目の行で終わりますが、その代わりに、縦線を下端まで表示し、円を未使用テーブルビューセル。プログラムでビューを作成しました。カスタムテーブルビューのセルは次のようになりますテーブルビュー全体をカバーするタイムラインビューを作成する
private func setUpTimeline(){
addSubview(bezierLine)
bezierLine.leftAnchor.constraint(equalTo: self.leftAnchor, constant: 92.5).isActive = true
bezierLine.topAnchor.constraint(equalTo: self.topAnchor).isActive = true
bezierLine.widthAnchor.constraint(equalToConstant: 0.8).isActive = true
bezierLine.bottomAnchor.constraint(equalTo: self.bottomAnchor).isActive = true
addSubview(circularCompletion)
circularCompletion.leftAnchor.constraint(equalTo: self.bezierLine.leftAnchor, constant: -12.5).isActive = true
circularCompletion.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true
circularCompletion.widthAnchor.constraint(equalToConstant: 25).isActive = true
circularCompletion.heightAnchor.constraint(equalToConstant: 25).isActive = true
addSubview(timeLabel)
timeLabel.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true
timeLabel.leftAnchor.constraint(equalTo: self.leftAnchor, constant: 8).isActive = true
timeLabel.rightAnchor.constraint(equalTo: self.bezierLine.leftAnchor).isActive = true
timeLabel.heightAnchor.constraint(equalToConstant: 30).isActive = true
addSubview(surveyNameLabel)
surveyNameLabel.leftAnchor.constraint(equalTo: self.bezierLine.rightAnchor, constant: 18).isActive = true
surveyNameLabel.topAnchor.constraint(equalTo: self.circularCompletion.topAnchor).isActive = true
surveyNameLabel.rightAnchor.constraint(equalTo: self.rightAnchor).isActive = true
surveyNameLabel.heightAnchor.constraint(equalToConstant: 20).isActive = true
addSubview(surveyDetailsLabel)
surveyDetailsLabel.leftAnchor.constraint(equalTo: self.surveyNameLabel.leftAnchor).isActive = true
surveyDetailsLabel.topAnchor.constraint(equalTo: self.surveyNameLabel.bottomAnchor, constant: 8).isActive = true
surveyDetailsLabel.rightAnchor.constraint(equalTo: self.surveyNameLabel.rightAnchor).isActive = true
surveyDetailsLabel.heightAnchor.constraint(equalToConstant: 15).isActive = true
}
残りの部分については、その行をフッタービューに入れるのはどうですか? – Larme