ListViewCell returned due to layout problems

This commit is contained in:
Vladimir Enchev
2015-05-26 15:44:06 +03:00
parent 392266b03b
commit 2feeed4d47

View File

@@ -19,6 +19,15 @@ require("utils/module-merge").merge(common, exports);
var infinity = utils.layout.makeMeasureSpec(0, utils.layout.UNSPECIFIED);
class ListViewCell extends UITableViewCell {
static new(): ListViewCell {
return <ListViewCell>super.new();
}
static class(): any {
return ListViewCell;
}
}
function notifyForItemAtIndex(listView: definition.ListView, cell: any, eventName: string, indexPath: NSIndexPath) {
var args = <definition.ItemEventData>{ eventName: eventName, object: listView, index: indexPath.row, view: cell.view, ios: cell, android: undefined };
listView.notify(args);
@@ -45,7 +54,7 @@ class DataSource extends NSObject implements UITableViewDataSource {
public tableViewCellForRowAtIndexPath(tableView: UITableView, indexPath: NSIndexPath): UITableViewCell {
// We call this method because ...ForIndexPath calls tableViewHeightForRowAtIndexPath immediately (before we can prepare and measure it).
var cell = tableView.dequeueReusableCellWithIdentifier(CELLIDENTIFIER) || UITableViewCell.new();
var cell = tableView.dequeueReusableCellWithIdentifier(CELLIDENTIFIER) || ListViewCell.new();
this._owner._prepareCell(cell, indexPath);
var cellView: view.View = cell.view;
@@ -106,7 +115,7 @@ class UITableViewDelegateImpl extends NSObject implements UITableViewDelegate {
// in iOS 7.1 this method is called before tableViewCellForRowAtIndexPath so we need fake cell to measure its content.
var cell = this._measureCell;
if (!cell) {
this._measureCell = tableView.dequeueReusableCellWithIdentifier(CELLIDENTIFIER) || UITableViewCell.new();
this._measureCell = tableView.dequeueReusableCellWithIdentifier(CELLIDENTIFIER) || ListViewCell.new();
cell = this._measureCell;
}
@@ -148,7 +157,7 @@ export class ListView extends common.ListView {
super();
this._ios = new UITableView();
this._ios.registerClassForCellReuseIdentifier(UITableViewCell.class(), CELLIDENTIFIER);
this._ios.registerClassForCellReuseIdentifier(ListViewCell.class(), CELLIDENTIFIER);
this._ios.autoresizesSubviews = false;
this._ios.autoresizingMask = UIViewAutoresizing.UIViewAutoresizingNone;