我正在尝试复制带有碎片的Honeycomb GMail UI,但做不到。
初始状态:
+--------+---------------+
| | |
|Accounts| Folders |
| | |
+--------+---------------+选择文件夹后:
+--------+---------------+
| | |
|Folders | Items |
| | |
+--------+---------------+其中帐户、文件夹和项目是片段。(很明显后退按钮应该转到初始状态)
我尝试了以下布局:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:id="@+id/root">
<FrameLayout
android:id="@+id/left_pane" android:layout_weight="1"
android:layout_width="0px" android:layout_height="match_parent" />
<FrameLayout
android:id="@+id/right_pane" android:layout_weight="1.6"
android:layout_width="0px" android:layout_height="match_parent" />
</LinearLayout>不幸的是,这不起作用,因为我不能将我的文件夹片段从右窗格移到左窗格(片段只能添加一次)。我可以创建新的文件夹,但这相当浪费资源,需要仔细的状态管理(特别是当后退按钮将被按下时),并且看起来不是我想要的样子。
我试着使用3个FrameLayouts (左,中,右,权重为1,1.6,2.56),但是当FrameLayout没有显示时,我不能让它折叠。任何帮助都是非常感谢的
发布于 2011-06-04 02:18:32
我认为你可以使用3 FrameLayouts并隐藏未使用的框架。因此,项目框架最初是隐藏的。在文件夹框架中选择某个项目时,帐户框架将隐藏,并且项目名称将可见。文件夹框架(或主要活动)必须截取后退按钮,以便它可以隐藏项目框架并使帐户框架可见。
https://stackoverflow.com/questions/5811922
复制相似问题