如何在Xamarin中创建按类别分组的调查表?

时间:2019-10-04 19:50:16

标签: xamarin xamarin.forms

我具有以下结构,我需要创建一个包含很多部分的表格,并且其中包含许多类别和类别内的问题。

如何在Xamarin中创建结构,如:

 Section -1
 + Category-1- 
         Questions 1
             Answers: Y/N
         Questions n
             Answers: Y/N
Category-2- 
         Questions
         Answers: Y/N

Section -2

Section -3

-....

-Section-n
   Category-n- 
         Questions n
            Answers: Y/N
         Questions n
            Answers: Y/N
   Category -n- 
         Questions n
            Answers: Y/N

示例:

a busy cat

Structure:

"sections": [
      {
        "sectionID": "string",            
        "sectionName": "string",
        "startDateSection": "2019-10-04T19:23:23.478Z",
        "categories": [
          {
            "categoryID": "string",            
            "categoryName": "string",
            "questions": [
              {
                "questionID": "string",
                "description": "string",
                "mandatory": true,
                "answers": [
                  {
                    "answerID": "string",
                    "answer": "string",
                    "dateInserted": "2019-10-04T19:23:23.479Z",
                    "dateModified": "2019-10-04T19:23:23.479Z",
                    "questionID": "string",
                    "startDateQuestion": "2019-10-04T19:23:23.479Z",
                    "inspectionsID": "string",
                    "medias": [
                      {

                        "fileAddress": "string",
                        "dateInserted": "2019-10-04T19:23:23.479Z",
                        "answerID": "string"
                      }
                    ],
              }
            ]
          }
        ]
      }
    ]

1 个答案:

答案 0 :(得分:0)

您的栏目似乎Pages不同,并且在图像中看不到类别。

但是将问题和答案放在ListView中,并可能使用将显示类别的标题将它们分组在一起是有意义的。

在ListView内部,您可以使用Grid作为ListView单元格的布局,以您想要的方式显示问题和答案