Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ActionsContentView 库是否包含任何用于展开和折叠父菜单项的方法?例如,一个菜单项可以有许多子项。在点击父项时,将显示子项。
示例:点击国家,然后新加坡、台湾和澳大利亚将出现。
国家 新加坡 台湾 澳大利亚
解决方案是在菜单项上膨胀所需的视图
// 我没有测试这个只是展示概念
View view = LayoutInflater.from(context_here).inflate(R.layout.the_layouttoinflate, null);