如何将自定义单元格调用到cellForRowAt...
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "incomeCell", for: indexPath) as! ViewControllerTableViewCell
return cell
}
如何在同一个函数中添加expensesCell
,以便我的表格都填充数据?
答案 0 :(得分:2)
将数组用于不同的tableview元素,这样你就可以:
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView == incomeTable {
return incomeElements.count
} else {
return expensesElements.count
}
}
请记住:
form:
tabs:
- name: tabMain
fields:
- !include:/n-components/dialogs/include/backgroundColorSelectField.yaml
- name: title
label: Title
class: info.magnolia.ui.form.field.definition.TextFieldDefinition
maxLength: 75
i18n: true
- name: tiles
label: Tiles
class: info.magnolia.ui.form.field.definition.MultiValueFieldDefinition
transformerClass: info.magnolia.ui.form.field.transformer.multi.MultiValueSubChildrenNodePropertiesTransformer
field:
name: compositeField
class: info.magnolia.editor.app.field.CollapsibleCompositeFieldDefinition
layout: vertival
label: Collapse
transformerClass: info.magnolia.ui.form.field.transformer.composite.DelegatingCompositeFieldTransformer
fields:
- name: tileTitle
label: Tile title
class: info.magnolia.ui.form.field.definition.TextFieldDefinition
- name: tileText
label: Tile text
class: info.magnolia.ui.form.field.definition.TextFieldDefinition
rows: 3
答案 1 :(得分:1)
可能的解决方案是为其中一个表格视图添加插座
patternProperties
但您可以使用部分一个表格视图实现相同的外观。