在android导航视图中的导航标题下方添加图片

时间:2018-11-20 11:00:32

标签: android navigation navigation-drawer navbar

我想在导航标题下方添加个人资料图片,以及如何在该菜单部分添加图片。我已经以编程方式添加了菜单,但是我想在菜单上方添加配置文件图像和名称,以及如何添加。

    

    <include
        layout="@layout/app_bar_drawer"
        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" />


    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_drawer">

    </android.support.design.widget.NavigationView>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:visibility="gone">


        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

        <ListView
            android:id="@+id/left_drawer"
            android:layout_width="240dp"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            android:background="#ffff"
            android:choiceMode="singleChoice"
            android:divider="@android:color/transparent"
            android:dividerHeight="0dp" />

    </LinearLayout>


</android.support.v4.widget.DrawerLayout>

0 个答案:

没有答案
相关问题