0
Ich habe eine Indikatoransicht. Wie kann ich es in Tabellenansicht Fußzeile anzeigen.Wie wird der Aktivitätsindikator in der Mitte der Fußzeile der Tabellenansicht angezeigt?
Ich habe eine Indikatoransicht. Wie kann ich es in Tabellenansicht Fußzeile anzeigen.Wie wird der Aktivitätsindikator in der Mitte der Fußzeile der Tabellenansicht angezeigt?
Zum Beispiel können Sie es wie folgt programmatisch Zentrum:
override func tableView(tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
if section == 0 {
let footerView = UIView(frame: CGRect.zero)
footerView.backgroundColor = UIColor.grayColor()
let activityView = UIActivityIndicatorView(activityIndicatorStyle: .Gray)
footerView.addSubview(activityView)
activityView.startAnimating()
activityView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint(
item: activityView,
attribute: .CenterX,
relatedBy: .Equal,
toItem: footerView,
attribute: .CenterX,
multiplier: 1.0,
constant: 0.0
).active = true
NSLayoutConstraint(
item: activityView,
attribute: .CenterY,
relatedBy: .Equal,
toItem: footerView,
attribute: .CenterY,
multiplier: 1.0,
constant: 0.0
).active = true
return footerView
} else {
return nil
}
}
danke für Hilfe –
Nehmen 'Horizontal' &' Vertical' Zentrum Einschränkung Indikator in 'UITableView' Fußzeile. –