I have a need to render a ColumnSet
as a UICollectionView
rather than the default UIStackView
. I couldn't find a clean way to do this by making a custom ColumnSet
renderer so instead I've created a custom element type but, so as not to reinvent the wheel, I want to use Column
elements to populate the cells of the UICollectionView
. Like so:
{
"type": "Carousel",
"items": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"size": "Large",
"weight": "Bolder",
"text": "Text 1"
}
],
"width": "stretch"
},
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"size": "Large",
"weight": "Bolder",
"text": "Text 2"
}
],
"width": "stretch"
}
]
}
Now, all I need is the vertical stack view that AdaptiveCards would render for each of those columns. But I can't figure out how to get the rendered view. If I send a column json to ACOAdaptiveCard.fromJson()
then I get an invalid parse result with error 3.
So the question boils down to, for any given json blob, how can I get the view that AC would have rendered in its normal render tree?
In other words, how to convert this:
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"size": "Large",
"weight": "Bolder",
"text": "Text 2"
}
],
"width": "stretch"
}
to a single UIStackView?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…