如图片部分所示,我做了这一部分。但是,我需要在该地点喜欢之前添加一个子实体,并且找不到如何处理2号零件。
XML代码
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ExpandableListView
android:id="@+id/drawer_list"
android:layout_width="240dp"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:background="#858585"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent" />
<ListView
android:id="@+id/right_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#858585"/>
</android.support.v4.widget.DrawerLayout>
您可以在相对布局中添加具有属性的布局,android:layout_alignParentBottom="true"
以使其底部对齐:
<RelativeLayout
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start" >
<!-- whatever the control you want here -->
<ExpandableListView
android:id="@+id/drawer_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#858585"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent" />
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Button1" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Button2" />
</LinearLayout>
</RelativeLayout>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句