如何在 android 导航抽屉中添加个人资料信息? [英] How to add profile information in android navigation drawer?

查看:17
本文介绍了如何在 android 导航抽屉中添加个人资料信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在使用 android.我成功地将 g 邮件中的 android 导航抽屉添加到我的应用程序中.现在我想添加一个图片中的个人资料图片视图.我在列表项中尝试过.但我想要更多的空间,就像图像中一样.我该怎么做???请帮助我,我是 android 新手

Hi I am working with android. I added android navigation drawer as in g mail to my app successfully.Now I want to add a profile picture view as in the image . I tried it in list item. but I want more space as just like in the image..How can I do this ??? Please help me I am new to android

这是我的列表项代码

        mTitle = mDrawerTitle = getTitle();

    // load slide menu items
    navMenuTitles = getResources().getStringArray(R.array.nav_drawer_items);

    // nav drawer icons from resources
    navMenuIcons = getResources()
            .obtainTypedArray(R.array.nav_drawer_icons);

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerList = (ListView) findViewById(R.id.list_slidermenu);

    navDrawerItems = new ArrayList<NavDrawerItem>();

    // adding nav drawer items to array
    // Home
    navDrawerItems.add(new NavDrawerItem(navMenuTitles[0], navMenuIcons.getResourceId(0, -1)));
    navDrawerItems.add(new NavDrawerItem(navMenuTitles[1], navMenuIcons.getResourceId(1, -1)));
    // Find People
    navDrawerItems.add(new NavDrawerItem(navMenuTitles[2], navMenuIcons.getResourceId(2, -1)));
    // Photos
    navDrawerItems.add(new NavDrawerItem(navMenuTitles[3], navMenuIcons.getResourceId(3, -1)));
    // Communities, Will add a counter here
    navDrawerItems.add(new NavDrawerItem(navMenuTitles[4], navMenuIcons.getResourceId(4, -1), true, "22"));
    // Pages
    navDrawerItems.add(new NavDrawerItem(navMenuTitles[5], navMenuIcons.getResourceId(5, -1)));
    // What's hot, We  will add a counter here
    navDrawerItems.add(new NavDrawerItem(navMenuTitles[6], navMenuIcons.getResourceId(6, -1), true, "50+"));


    // Recycle the typed array
    navMenuIcons.recycle();

    mDrawerList.setOnItemClickListener(new SlideMenuClickListener());

    // setting the nav drawer list adapter
    adapter = new NavDrawerListAdapter(getApplicationContext(),
            navDrawerItems);
    mDrawerList.setAdapter(adapter);

推荐答案

首先我想说你需要按照重要性对信息进行排序.用户名可能是最重要的,因此他们需要看到什么来告诉他们

Firstly I'd say you need to rank your information in order of importance. The users name being, presumably, the most important and therefore what they need to see to tell them

a) 他们已经登录并且

a) they are logged in and

b) 他们使用哪个帐户登录.

b) which account they're logged in with.

更多请点击此链接https://ux.stackexchange.com/questions/44776/navigation-drawer-与我的帐户条目

这篇关于如何在 android 导航抽屉中添加个人资料信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆