我正在开发应用程序,我需要导航抽屉,.I使用google的代码开发导航抽屉
<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 to display Fragments -->
<FrameLayout
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- Listview to display slider menu -->
<ListView
android:id="@+id/list_slidermenu"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:background="#6495ED"
android:choiceMode="singleChoice"
android:divider="@color/list_divider"
android:dividerHeight="1dp"
android:listSelector="#fff" />
</android.support.v4.widget.DrawerLayout>这样我就得到了一个导航抽屉,但是我想在列表视图之上放置一个图片视图,.I搜索了它,但是我不知道我的方法。
发布于 2015-03-16 11:04:38
我们可以添加一个HeaderView来列出这一点,userImage将出现在listView之上,比如ViewGroup header = (ViewGroup) inflater.inflate(R.layout.headerview,mDrawerList,false);
mDrawerList.addHeaderView(header, null, false);https://stackoverflow.com/questions/28828938
复制相似问题