{"id":1059,"date":"2015-12-16T22:25:17","date_gmt":"2015-12-16T14:25:17","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=1059"},"modified":"2026-08-18T12:58:45","modified_gmt":"2026-08-18T04:58:45","slug":"%e4%ba%8c%e7%ba%a7%e4%b8%8b%e6%8b%89%e5%88%97%e8%a1%a8%e8%8f%9c%e5%8d%95expandtabview%e6%94%b9%e8%bf%9b%e7%89%88%ef%bc%88%e4%bb%bf%e7%be%8e%e5%9b%a2%ef%bc%8c%e5%a4%a7%e4%bc%97%e7%82%b9%e8%af%84","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=1059","title":{"rendered":"\u4e8c\u7ea7\u4e0b\u62c9\u5217\u8868\u83dc\u5355ExpandTabView\u6539\u8fdb\u7248\uff08\u4eff\u7f8e\u56e2\uff0c\u5927\u4f17\u70b9\u8bc4\uff09"},"content":{"rendered":"<section id=\"wenyan\" style=\"font-family: system-ui, 'Apple Color Emoji', 'Segoe UI', 'Segoe UI Symbol', 'Noto Sans', Roboto, sans-serif; line-height: 1.75; font-size: 16px; color: #000000; caret-color: #000000;\" data-provider=\"WenYan\">\n<blockquote style=\"margin: 20px 0px; display: block; font-size: 0.9em; overflow: auto; border-left: 3px solid #ef7060; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"margin: 1em 0px;\">\u7f8e\u56e2\u3001\u5927\u4f17\u70b9\u8bc4\u4e00\u7c7b App \u5e38\u89c1\u4e8c\u7ea7\u4e0b\u62c9\u7b5b\u9009\u3002\u7f51\u4e0a\u5df2\u6709 ExpandTabView\uff0cGithub \u53ef\u70b9 <a href=\"https:\/\/github.com\/yueyueniao2012\/ExpandTabView\">DownLoad<\/a>\u3002\u8fd9\u91cc\u505a\u4e00\u7248\u6539\u8fdb\uff0c\u987a\u5e26\u7ec3 PopupWindow\u3001\u81ea\u5b9a\u4e49\u63a7\u4ef6\u3001\u81ea\u5b9a\u4e49 ToggleButton \u548c\u56de\u8c03\u3002<\/p>\n<\/blockquote>\n<p><!--more--><\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e00\u3001\u6548\u679c\u4e0e\u6570\u636e\u6e90<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u5b9e\u73b0\u6548\u679c\uff1a<\/p>\n<p style=\"margin: 1em 0px;\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-1060\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/12\/ExpandTab.gif\" alt=\"ExpandTab\" width=\"344\" height=\"541\" \/><\/p>\n<p style=\"margin: 1em 0px;\">\u4ef7\u683c\u3001\u6392\u5e8f\u3001\u4f18\u60e0\u5404\u4e00\u4e2a List\uff1b\u533a\u57df\u6709\u4e8c\u7ea7\uff0c\u9700\u8981\u7236 List \u548c\u5b50 List \u7684 List\u3002<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">private List&lt;KeyValueBean&gt; mPriceLists; \/\/ \u4ef7\u683c\nprivate List&lt;KeyValueBean&gt; mSortLists;  \/\/ \u6392\u5e8f\nprivate List&lt;KeyValueBean&gt; mFavorLists; \/\/ \u4f18\u60e0\nprivate List&lt;KeyValueBean&gt; mParentLists = new ArrayList&lt;&gt;(); \/\/ \u7236\u533a\u57df\nprivate List&lt;ArrayList&lt;KeyValueBean&gt;&gt; mChildrenListLists = new ArrayList&lt;&gt;(); \/\/ \u5b50\u533a\u57df\n\nclass KeyValueBean {\n    private String key;\n    private String value;\n}<\/code><\/pre>\n<table style=\"border-collapse: collapse; margin: 1.4em auto; max-width: 100%; table-layout: fixed; text-align: left; overflow: auto; display: table; overflow-wrap: break-word; word-break: break-all;\" width=\"817\">\n<thead>\n<tr>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">Tab<\/th>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u5f39\u51fa View<\/th>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u6570\u636e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u4ef7\u683c \/ \u6392\u5e8f \/ \u4f18\u60e0<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">PopOneListView<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u5355\u4e2a List&lt;KeyValueBean&gt;<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u533a\u57df<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">PopTwoListView<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u7236 List + \u5b50 List \u7684 List<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e8c\u3001\u5f15\u5165\u5e93\u4e0e\u5e03\u5c40<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u7b2c\u4e09\u65b9\u5305\u4e0b\u8f7d\u8bf7\u79fb\u6b65\u8fd9\u91cc <a href=\"https:\/\/github.com\/yihu0817\/ExpandPopTabView\/tree\/master\/android-expandpoptab-library\">DownLoad<\/a>\u3002Activity \u5e03\u5c40\u91cc\u653e\u81ea\u5b9a\u4e49\u63a7\u4ef6 ExpandPopTabView\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">&lt;com.warmtel.expandtab.ExpandPopTabView\n        android:id=\"@+id\/expandtab_view\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\" \/&gt;<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u5f39\u51fa View \u7528\u5e93\u91cc\u9ed8\u8ba4\u7684 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">PopOneListView<\/code> \u548c <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">PopTwoListView<\/code>\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">PopOneListView popOneListView = new PopOneListView(this);\nPopTwoListView popTwoListView = new PopTwoListView(this);<\/code><\/pre>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e09\u3001\u5173\u8054\u6570\u636e\u3001\u9ed8\u8ba4\u9009\u4e2d\u4e0e\u5c01\u88c5<\/span><\/h2>\n<p style=\"margin: 1em 0px;\"><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">setCallBackAndData<\/code> \u7ed1\u6570\u636e\u548c\u70b9\u51fb\u56de\u8c03\uff0c\u518d <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">addItemToExpandTab<\/code> \u6302\u5230\u9876\u680f\u3002\u4e5f\u53ef\u7528 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">setDefaultSelectByValue<\/code> \u8bbe\u9ed8\u8ba4\u9879\u3002<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">popOneListView.setCallBackAndData(lists, expandTabView, new PopOneListView.OnSelectListener() {\n    @Override\n    public void getValue(String key, String value) {\n        \/\/ \u5f39\u51fa\u6846\u9009\u9879\u70b9\u51fb\u9009\u4e2d\u56de\u8c03\u65b9\u6cd5\n    }\n});\nexpandTabView.addItemToExpandTab(defaultShowText, popViewOne);\n\npopTwoListView.setCallBackAndData(expandTabView, parentLists, childrenListLists, new PopTwoListView.OnSelectListener() {\n    @Override\n    public void getValue(String showText, String parentKey, String childrenKey) {\n        \/\/ \u5f39\u51fa\u6846\u9009\u9879\u70b9\u51fb\u9009\u4e2d\u56de\u8c03\u65b9\u6cd5\n    }\n});\nexpandTabView.addItemToExpandTab(defaultShowText, distanceView);\n\npopOneListView.setDefaultSelectByValue(defaultSelect);\npopTwoListView.setDefaultSelectByValue(defaultParentSelect, defaultChildSelect);<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u5c01\u88c5\u4e24\u4e2a <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">addItem<\/code> \u91cd\u8f7d\uff0c\u4e00\u7ea7\u3001\u4e8c\u7ea7\u5404\u8d70\u4e00\u904d\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">public void addItem(ExpandPopTabView expandTabView, List&lt;KeyValueBean&gt; lists, String defaultSelect, String defaultShowText) {\n    PopOneListView popOneListView = new PopOneListView(this);\n    popOneListView.setDefaultSelectByValue(defaultSelect);\n    popOneListView.setCallBackAndData(lists, expandTabView, new PopOneListView.OnSelectListener() {\n        @Override\n        public void getValue(String key, String value) {\n            \/\/ \u5f39\u51fa\u6846\u9009\u9879\u70b9\u51fb\u9009\u4e2d\u56de\u8c03\u65b9\u6cd5\n        }\n    });\n    expandTabView.addItemToExpandTab(defaultShowText, popOneListView);\n}\n\npublic void addItem(ExpandPopTabView expandTabView, List&lt;KeyValueBean&gt; parentLists,\n                    List&lt;ArrayList&lt;KeyValueBean&gt;&gt; childrenListLists, String defaultParentSelect, String defaultChildSelect, String defaultShowText) {\n    PopTwoListView popTwoListView = new PopTwoListView(this);\n    popTwoListView.setDefaultSelectByValue(defaultParentSelect, defaultChildSelect);\n    popTwoListView.setCallBackAndData(expandTabView, parentLists, childrenListLists, new PopTwoListView.OnSelectListener() {\n        @Override\n        public void getValue(String showText, String parentKey, String childrenKey) {\n            \/\/ \u5f39\u51fa\u6846\u9009\u9879\u70b9\u51fb\u9009\u4e2d\u56de\u8c03\u65b9\u6cd5\n        }\n    });\n    expandTabView.addItemToExpandTab(defaultShowText, popTwoListView);\n}<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u8c03\u7528\u65b9\u5f0f\uff08\u4ef7\u683c\u3001\u6392\u5e8f\u3001\u4f18\u60e0\u3001\u533a\u57df\uff09\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">ExpandPopTabView expandTabView = (ExpandPopTabView) findViewById(R.id.expandtab_view);\naddItem(expandTabView, mPriceLists, \"\", \"\u4ef7\u683c\");\naddItem(expandTabView, mFavorLists, \"\u9ed8\u8ba4\", \"\u6392\u5e8f\");\naddItem(expandTabView, mSortLists, \"\u4f18\u60e0\u6700\u591a\", \"\u4f18\u60e0\");\naddItem(expandTabView, mParentLists, mChildrenListLists, \"\u9526\u6c5f\u533a\", \"\u5408\u6c5f\u4ead\", \"\u533a\u57df\");<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u5bf9\u4e0a\u8ff0\u4f7f\u7528\u65b9\u5f0f\u8fd8\u4e0d\u6e05\u695a\u7684\u540c\u5b66\u53ef\u4ee5\u5230\u8fd9\u91cc\u4e0b\u8f7d\u6e90\u7801 Demo\uff1a<a href=\"https:\/\/github.com\/yihu0817\/ExpandPopTabView\">\u6e90\u7801\u4e0b\u8f7d<\/a><\/p>\n<blockquote style=\"margin: 20px 0px; display: block; font-size: 0.9em; overflow: auto; border-left: 3px solid #ef7060; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"margin: 1em 0px;\"><strong>\u4e00\u53e5\u8bdd\u603b\u7ed3\uff1a\u4e00\u7ea7\u7528 PopOneListView\uff0c\u4e8c\u7ea7\u7528 PopTwoListView\uff0caddItem \u5c01\u88c5\u540e\u5f80 ExpandPopTabView \u4e0a\u6302\u5373\u53ef\u3002<\/strong><\/p>\n<\/blockquote>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u7f8e\u56e2\u3001\u5927\u4f17\u70b9\u8bc4\u4e00\u7c7b App \u5e38\u89c1\u4e8c\u7ea7\u4e0b\u62c9\u7b5b\u9009\u3002\u7f51\u4e0a\u5df2\u6709 ExpandTabView\uff0cGithub \u53ef\u70b9 Dow [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[69],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1059"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1059"}],"version-history":[{"count":3,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1059\/revisions"}],"predecessor-version":[{"id":1069,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1059\/revisions\/1069"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}