【发布时间】:2014-03-26 12:52:29
【问题描述】:
我使用的是 android 开发网站中的抽屉导航,但它没有在列表视图中显示标题或标题或图像,所以你能告诉我如何在 android 开发中的抽屉导航中添加标题和图像网站没有? Like this example
以下是部分代码:<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">
<!-- As the main content view, the view below consumes the entire
space available using match_parent in both dimensions. -->
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<!-- android:layout_gravity="start" tells DrawerLayout to treat
this as a sliding drawer on the left side for left-to-right
languages and on the right side for right-to-left languages.
The drawer is given a fixed width in dp and extends the full height of
the container. A solid background is used for contrast
with the content view. -->
<ListView
android:layout_weight="1"
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="fill_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="1dp"
android:background="@color/Black"/>
</android.support.v4.widget.DrawerLayout>
【问题讨论】:
-
使用自定义列表视图。 google 搜索同样你会发现很多例子
标签: android