找回密码
 立即注册
android开发 2022-11-07 42 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
一个Android无限级树菜单的实践代码,具体演示了一个树形菜单的制作进程,用到的重要点都附加了注释,学习制作树形菜单是完美的范例。可理解到如何设置父节点、取得父节点、设置节点文本、设置节点图标文件、清除所有子节点、删去指定位置的子节点、设置是否具有复选框、是否为叶节点,即没有子节点的节点、递归判别所给的节点是否当前节点的父节点、递归判别父节点是否处于折叠状况,有一个父节点折叠则认为是折叠状况等。关于函数的定义说明:privateNodeparent;//父节点privateListchildren=newArrayList();//子节点privateStringtext;//节点显示的文字privateStringvalue;//节点的值privateinticon=-1;//是否显示小图标,-1表示隐藏图标privatebooleanisChecked=false;//是否处于选中状况privatebooleanisExpanded=true;//是否处于打开状况privatebooleanhasCheckBox=true;//是否具有复选框
Node框架函数
@paramtext节点显示的文字
@paramvalue节点的值

(A practical code of Android infinite tree menu, which specifically demonstrates the process of making a tree menu. All the important points used are annotated. Learning to make a tree menu is a perfect example. You can understand how to set the parent node, get the parent node, set the node text, set the node icon file, clear all child nodes, delete the child nodes at the specified location, set whether there is a check box, whether it is a leaf node, that is, a node without a child node, recursively determine whether the given node is the parent node of the current node, recursively determine whether the parent node is in a collapsed state, and if there is a collapsed parent node, it is considered a collapsed state. Description of function definition: privateNode parent// Parent node privateListchildren=newArrayList()// The child node privateStringtext// The text privateStringvalue displayed by the node// The value of the node privateenticon=- 1// Whether to display small icons, - 1 means to hide the icon privatepoolenisChecked=false// Whether it is selected privatepoolenisExpanded=true// Whether it is in the open status privatebooleanhasCheckBox=true// Check box
Node Frame Functions
@Text displayed by paramtext node
@The value of the paramvalue node)

[下载]11595531629.rar




上一篇:Android对话框dialog实例源码集
下一篇:Android动态桌面LiveWallpaper源代码