从Android的JSON创建动态表格 [英] Create Dynamic form from json in android

查看:168
本文介绍了从Android的JSON创建动态表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在android开发新的。我喜欢做学生注册一个应用程序,以便在这我想从 JSON 文件动态创建的形式。而形式是像视图向导。我不知道如何做到这一点动态,请帮我创建这个。

我有以下JSON文件:

  {
    屏蔽1:{
    基本信息 :[
        {
            ID:3
            类型:生日,
            订货:2
            名:生日
            提示:输入你的出生日期,以便其他用户就可以知道什么时候,祝你生日快乐,
            选择:,
        },
        {
            ID:4,
            类型:文本区域,
            订货:3
            名:关于我,
            提示:请告诉我们更多关于你自己,
            选择:,
        },
        {
            ID:16,
            类型:选择,
            订货:4,
            名:婚姻状况,
            提示:单身或已婚
            选择:
                已婚,
                未婚,
                离婚
            ]        }
    ]
},    SCREEN3:
    {
     教育:
        {
            ID:14,
            类型:文本,
            名:学院/大学
            提示:你的大学或学院的名称,
            选择:,
        },
        {
            ID:15
            类型:文本,
            订货:16,
            名:毕业年,
            提示:毕业年,
            选择:,
        }
    ]
}
}


解决方案

抱歉长的答案:
 尝试:


  

屏蔽1: - >\\屏蔽1 \\+:
  这样,只改变,以\\


I am new in android development. I am making one application like student registration so in that I want to create form dynamically from JSON file. and that forms are in the wizard like view. I have no idea that how to do this dynamically please help me to create this.

I have following JSON file :

{
    "screen1": {
    "Basic Information" :[
        {
            "id": "3",
            "type": "birthdate",
            "ordering": "2",
            "name": "Birthdate",
            "tips": "Enter your date of birth so other users can know when to wish you happy birthday ",
            "options": "",
        },
        {
            "id": "4",
            "type": "textarea",
            "ordering": "3",
            "name": "About me",
            "tips": "Tell us more about yourself",
            "options": "",
        },
        {
            "id": "16",
            "type": "select",
            "ordering": "4",
            "name": "marital status",
            "tips": "single or married",
            "options": [
                "Married",
                "Unmarried",
                "Divorcee"
            ],

        }
    ]
},

    "screen3":
    {
     "Education" :[
        {
            "id": "14",
            "type": "text",
            "name": "College / University",
            "tips": "Your college or university name",
            "options": "",
        },
        {
            "id": "15",
            "type": "text",
            "ordering": "16",
            "name": "Graduation Year",
            "tips": "Graduation year",
            "options": "",
        }
    ]
}
}

解决方案

sorry for long answer: try:

"screen1": -> "\"screen1\" " +":" like this, only change " to " \" "

这篇关于从Android的JSON创建动态表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆