0
我正在使用Shinobi Data Grid,但我遇到了一个小问题,因为有关Shinobi Grid的Swift示例或问题很难找到。下面我的代码片段:Swift:Shinobi Grid中的自动文本
var grid: ShinobiDataGrid?
grid = ShinobiDataGrid(frame: self.view.bounds)
grid?.frame = CGRect(x: 0, y: 120, width: (screenWidth), height: 600)
theme = SDataGridTheme()
theme?.iOS7Arrows = true
theme?.hideVerticalGridlines = false
grid?.apply(theme)
self.view.addSubview(grid!)
.........
addColumn(grid!, title: "Floor", width: 100, alignment: .right, alignmentHeader: .right)
grid?.numberOfFrozenColumns = 2
grid?.layer.borderWidth = 1
grid?.defaultCellStyleForHeaderRow.backgroundColor = UIColor(hex: "#1A237E")
grid?.defaultCellStyleForHeaderRow.textColor = UIColor.white
grid?.defaultCellStyleForHeaderRow.font.withSize(5)
grid?.dataSource = self
grid?.delegate = self
........
func shinobiDataGrid(_ grid: ShinobiDataGrid!, prepareCellForDisplay cell: SDataGridCell!) {
let textCell = cell as! SDataGridTextCell
// let textCell = cell as! SDataGridMultiLineTextCell
var dataRow: [AnyHashable: Any]?
dataRow = filteredDataRoomingList?[cell.coordinate.row.rowIndex] as? [AnyHashable: Any]
textCell.sizeToFit()
if (searchBarActive) {
dataRow = filteredSearchDataRoomingList?[cell.coordinate.row.rowIndex] as? [AnyHashable: Any]
}
else {
dataRow = filteredDataRoomingList?[cell.coordinate.row.rowIndex] as? [AnyHashable: Any]
}
if textCell.coordinate.column.tag == 0 {
textCell.textField.text = (String(dataRow?["floor"] as! Int))
// gridMultiLine.textLabel.text = (String(dataRow?["floor"] as! Int))
}
}
我想我的手机显示的内容(包装内容)里面的全文不是截断文本......。
我读this但我没有想法与该块,因为它的目标C:
SDataGridColumn *nameColumn = [[SDataGridColumn alloc] initWithTitle:@"Forename" cellType:[SDataGridMultiLineTextCell class]];
nameColumn.editable = YES;
nameColumn.width = @250;
[self.shinobiDataGrid addColumn:nameColumn];
的任何建议和答案将帮助我。在此先感谢