我正在寻找创建一个的最佳方法手风琴式小部件,如本页所示 http://labs.adobe.com/technologies/spry/samples/accordion/AccordionSample.html。
有没有办法使用标准 Android 工具包达到相同的效果,或者我是否需要构建自定义小部件?如果是这样 - 如果有的话,您会建议延长哪一项?
如果您仍然想知道 - 这几乎可以通过堆叠在线性布局内部的一对按钮/布局来完成。伪代码如下
<LinearLayout android:orientation="vertical">
<Button android:text="Panel 1"/>
<SomeKindOfLayout android:id="@+id/panel1">
<!-- widgets in first panel go here -->
</SomeKindOfLayout>
<Button android:text="Panel 2"/>
<SomeKindOfLayout android:id="@+id/panel2" android:visibility="gone">
<!-- widgets in second panel go here -->
</SomeKindOfLayout>
<Button android:text="Panel 3"/>
<SomeKindOfLayout android:id="@+id/panel3" android:visibility="gone">
<!-- widgets in third panel go here -->
</SomeKindOfLayout>
<Button android:text="Panel 4"/>
<SomeKindOfLayout android:id="@+id/panel4" android:visibility="gone">
<!-- widgets in fourth panel go here -->
</SomeKindOfLayout></LinearLayout>
另一件可以尝试的事情是将 ExpandableListView-s 堆叠在一起
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)