第七章 AXF (ActXmlFromFramework) 活动ANDROID页面展现框架 android动态加载页面框架

8.5个人信息录入页面1

  添加个人信息页面的代码比较简单,只需要把录入项目按照事先做好的模型添加进去就可以了,我们行看一下第一个个人信息页面inform1.xml的代码:

<?xml version="1.0"encoding="UTF-8" ?>

<axf>

<form id="form1"name="actTemplate" passpage="" nextpage="inform2">       

    <layout type="layout" layout_width="match_parent"layout_height="match_parent" background="@color/WHILT" orientation="vertical" >

        <field name="AXF001" label="证件类型" type="choice"required="Y" maxLength="10"laWidth="" txWidth="220"singleLine="true" options=""/>

    </layout>

    <layout id="l5" type="layout"layout_width="match_parent" layout_height="match_parent" background="@color/WHILT" orientation="vertical" >         

        <field name="XF010" label="姓名" type="text"required="N" maxLength="10"laWidth="" txWidth="150"singleLine="true" options=""/>

        <field name="XF011" label="拼音" type="text"required="N" maxLength="10"laWidth="" txWidth="150"singleLine="true" options=""/>

    </layout>

    <layout id="l6" type="layout"layout_width="match_parent" layout_height="match_parent" background="@color/WHILT" orientation="vertical" >         

        <field name="AXF006" label="性别" type="radio"required="N" maxLength="10"laWidth="" txWidth="150"singleLine="true" options=""/>

        <field name="AXF007" label="婚姻状况" type="check"required="N" maxLength="10"laWidth="" txWidth="150"singleLine="true" options=""/>

    </layout>

    <layout id="l7" type="layout"layout_width="match_parent" layout_height="match_parent" background="@color/WHILT" orientation="vertical" >         

        <field name="AXF002" label="教育程度" type="choice"required="N" maxLength="10"laWidth="" txWidth="380"singleLine="true" options=""/>   

    </layout>

    <layout type="layout" layout_width="match_parent"layout_height="match_parent" background="@color/WHILT" orientation="vertical" >           

        <field name="AXF012" label="证件号码" type="numeric"required="N" maxLength="20"laWidth="" txWidth="380"singleLine="true" options=""/>

    </layout>

    <layout type="layout" layout_width="match_parent"layout_height="match_parent" background="@color/WHILT" orientation="vertical" >           

        <field name="AXF013" label="发证机关" type="text"required="N" maxLength="20"laWidth="" txWidth="150"singleLine="true" options=""/>

        <field name="AXF014" label="国籍" type="text"required="N" maxLength="20"laWidth="" txWidth="150"singleLine="true" options=""/>

    </layout>

    <layout type="layout" layout_width="match_parent"layout_height="match_parent" background="@color/WHILT" orientation="vertical" >           

        <field name="AXF015" label="出生日期" type="numeric"required="N" maxLength="8"laWidth="" txWidth="150"singleLine="true" options=""/>

        <field name="AXF016" label="有效期" type="numeric"required="N" maxLength="8"laWidth="" txWidth="150"singleLine="true" options=""/>

    </layout>

    <layout type="layout" layout_width="match_parent"layout_height="match_parent" background="@color/WHILT" orientation="vertical" >           

        <field name="AXF037" label="户籍地址" type="text"required="N" maxLength="80"laWidth="" txWidth="380"singleLine="true" options=""/>

    </layout>      

    <layout type="layout" layout_width="match_parent"layout_height="match_parent" background="@color/WHILT" orientation="vertical" >

        <field name="nextpage" label="下一页" type="button"required="" maxLength=""options="" laWidth=""txWidth="120" singleLine="true"/>

    </layout>

</form>

</axf>

由于它是第一个页面,所以FORM标签中不需要PASSPAGE属性,它的NEXTPAGE属性值为inform2.xml,也就是说当点击下一页按钮时,页面会跳转到第二个页面。大家一起看一下第一个页面的效果图:

接下来是第二个页面的代码:

<?xml version="1.0"encoding="UTF-8" ?>

<axf>

    <form id="form3" name="actTemplat3e"passpage="inform1" nextpage="inform3">

        <layout type="layout" layout_width="match_parent"layout_height="match_parent" background="@color/WHILT" orientation="vertical" >         

            <field name="AXF021" label="单位名称" type="text"required="N" maxLength="200"laWidth="" txWidth="380"singleLine="true" options=""/>

        </layout>

        <layout type="layout" layout_width="match_parent"layout_height="match_parent" background="@color/WHILT" orientation="vertical" >         

            <field name="AXF022" label="任职部门" type="text"required="N" maxLength="20"laWidth="" txWidth="150"singleLine="true" options=""/>

            <field name="AXF023" label="任职岗位" type="text"required="N" maxLength="20"laWidth="" txWidth="150"singleLine="true" options=""/>

        </layout>

        <layout type="layout" layout_width="match_parent"layout_height="match_parent" background="@color/WHILT" orientation="vertical" >         

            <field name="AXF024" label="单位电话" type="numeric"required="N" maxLength="4"laWidth="" txWidth="380"singleLine="true" options=""/>

        </layout>

        <layout type="layout" layout_width="match_parent"layout_height="match_parent" background="@color/WHILT" orientation="vertical" >         

            <field name="AXF027" label="备注信息" type="text"required="N" maxLength="20"laWidth="" txWidth="380"singleLine="true" options=""/>

        </layout>

        <layout type="layout" layout_width="match_parent"layout_height="match_parent" background="@color/WHILT" orientation="vertical" >         

            <field name="AXF028" label="单位地址" type="text"required="N" maxLength="40"laWidth="" txWidth="380"singleLine="true" options=""/>

            </layout>

        <layout type="layout" layout_width="match_parent"layout_height="match_parent" background="@color/WHILT" orientation="vertical" >         

            <field name="AXF029" label="单位邮编" type="numeric"required="N" maxLength="6"laWidth="" txWidth="150"singleLine="true" options=""/>

            <field name="AXF003" label="单位性质" type="choice"required="N" maxLength="20"laWidth="" txWidth="150"singleLine="true" options=""/>

        </layout>

        <layout type="layout" layout_width="match_parent"layout_height="match_parent" background="@color/WHILT" orientation="vertical" > 

            <field name="passpage" label="上一页" type="button"required="" maxLength=""options="" laWidth=""txWidth="120" singleLine="true"/>      

            <field name="nextpage" label="下一页" type="button"required="" maxLength=""options="" laWidth=""txWidth="120" singleLine="true"/>

        </layout>

    </form>

</axf>

第二个页面和第一个页面不同的地方在于,FORM标签的PASSPAGE属性值为inform1.xml,NEXTPAGE属性值为inform3.xml,表明在当前页面点击上一面会回到第一个页面,下一页时会跳转到新的第三个页面中,跳转的动作已经在AXF内部实现,我们不需要写任何代码就可以实现效果,一起看一下第三个页面的效果:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值