Hello,
For a question I am implementing I have 16 images that I would like to present in a 4 x 4 grid.
The documentation for ORKImageChoice indicates that "typically, image choices are displayed in a horizontal row" , but I don't want that. How can I layout the images in a grid?
Here is my code thats is displaying the images inline:
let pamTuples = [
(UIImage(named: "1_1")!, "1"),
(UIImage(named: "1_2")!, "2"),
(UIImage(named: "1_3")!, "3"),
(UIImage(named: "2_1")!, "4"),
(UIImage(named: "2_2")!, "5"),
(UIImage(named: "2_3")!, "6")
]
let imageChoices : [ORKImageChoice] = pamTuples.map {
return ORKImageChoice(normalImage: $0.0, selectedImage: nil, text: $0.1, value: $0.1)
}
let pamAnswerFormat: ORKImageChoiceAnswerFormat = ORKAnswerFormat.choiceAnswerFormatWithImageChoices(imageChoices)
let pamQuestionStep = ORKQuestionStep(identifier: "mood image", title: pamQuestionStepTitle, answer: pamAnswerFormat)
Thanks,
Adam