Closed derekgould closed 6 years ago
Sure, here's an example:
import UIKit
import Eureka
import ViewRow
class ViewController: FormViewController {
override func viewDidLoad() {
super.viewDidLoad()
form
+++ Section("Section 1")
<<< LabelRow() { (row) in
row.title = "Row Above"
row.value = "12345"
}
<<< ViewRow<UIImageView>()
.cellSetup { (cell, row) in
// Construct the view for the cell
cell.view = UIImageView()
cell.contentView.addSubview(cell.view!)
// Get something to display
let image = UIImage(named: "trees")
cell.view!.image = image
// Make the image view occupy the entire row:
cell.viewRightMargin = 0.0
cell.viewLeftMargin = 0.0
cell.viewTopMargin = 0.0
cell.viewBottomMargin = 0.0
// Define the cell's height
cell.height = { return CGFloat(300) }
}
<<< LabelRow() { (row) in
row.title = "Row Below"
row.value = "12345"
}
+++ Section("Section 2")
<<< LabelRow() { (row) in
row.title = "Label Row"
row.value = "12345"
}
}
}
Here's the example project: ViewRowTest.zip
i got this error, can u help?
Do you have all the imports you need at the head of your file?
import UIKit
import Eureka
import ViewRow
Were you able to resolve your problem?
May be version of ViewRow conflict with Eureka, its work normally after using pod. Thank
Can anyone suggest how to display a uiimage full-width and full-height in a viewrow cell?