UITableViewWrapperView
la dimensione non cambia in base al contenuto se l'altezza della riga è UITableViewAutomaticDimension
.La dimensione di UITableViewWrapperView non cambia in base al contenuto se l'altezza della riga è UITableViewAutomaticDimension
Sto tentando di creare un elenco di feed con TableView e righe di altezza dinamica. TableView è scorrevole ma UITableViewWrapperView
sembra che non stia cambiando le sue dimensioni!
Di seguito è riportato il codice e lo screenshot della gerarchia di viste.
Penso che sia strano.
Codice:
class FeedController: UITableViewController {
var items: NSMutableArray = []
override func viewDidLoad() {
super.viewDidLoad()
refreshControl?.addTarget(self, action: "feedLoad", forControlEvents: UIControlEvents.ValueChanged)
self.feedLoad()
}
override func tableView(tableView: UITableView, estimatedHeightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 120.0
}
override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
println("called")
return UITableViewAutomaticDimension
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.items.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
return self.getCellForItemAtIndexPath(indexPath)
}
func getCellForItemAtIndexPath(indexPath: NSIndexPath) -> UITableViewCell {
let item: Dictionary = self.items[indexPath.row] as Dictionary<String, AnyObject>
let cell = tableView.dequeueReusableCellWithIdentifier((item["type"] as String) + "Cell", forIndexPath: indexPath) as FeedViewCell
cell.fillData(item)
return cell as UITableViewCell
}
func feedLoaded(){
tableView.reloadData()
}
func feedLoad(){
// Feed Load Logic which will call next line once feed loaded
self.feedLoaded()
}
}
Sto avendo lo stesso problema e ancora non riesco a trovare una risposta ad esso. – Kex
Quali sono i tuoi vincoli? – jszumski
ha lo stesso problema, l'hai risolto? –