gpt4 book ai didi

android - 抽屉机器人,删除箭头

转载 作者:行者123 更新时间:2023-11-29 00:07:36 26 4
gpt4 key购买 nike

我的应用程序中有抽屉,我使用这个库:com.mikepenz:materialdrawer当我制作抽屉时,我有一个箭头,我该如何将其移除?以及如何在抽屉中制作个人资料的圆形图像?

enter image description here
就是这个:enter image description here

这是我的抽屉代码:

AccountHeader headerResult = new AccountHeaderBuilder()
.withActivity(activity)
.withHeaderBackground(R.drawable.header)
.addProfiles(
new ProfileDrawerItem().withName(activity.getResources().getString(R.string.nickname))
.withEmail(activity.getResources().getString(R.string.drawer_second_line))
.withIcon(activity.getResources().getDrawable(R.drawable.schooler)))
.build();

Drawer result = new DrawerBuilder()
.withAccountHeader(headerResult)
.withActivity(activity)
.withToolbar(toolbar)
.withTranslucentStatusBar(false)
.withActionBarDrawerToggle(true)
.addDrawerItems(
new PrimaryDrawerItem().withName(R.string.drawer_item_card).withIcon(FontAwesome.Icon.faw_credit_card).withIdentifier(1),
new PrimaryDrawerItem().withName(R.string.drawer_item_pay).withIcon(FontAwesome.Icon.faw_money),
new PrimaryDrawerItem().withName(R.string.drawer_item_lock).withIcon(FontAwesome.Icon.faw_lock).withIdentifier(2),
new DividerDrawerItem(),
new SecondaryDrawerItem().withName(R.string.drawer_item_journal).withIcon(FontAwesome.Icon.faw_book),
new SecondaryDrawerItem().withName(R.string.drawer_item_homework).withIcon(FontAwesome.Icon.faw_calendar),
new SecondaryDrawerItem().withName(R.string.drawer_item_food).withIcon(FontAwesome.Icon.faw_cutlery),
new SecondaryDrawerItem().withName(R.string.drawer_item_contact).withIcon(FontAwesome.Icon.faw_comment).withIdentifier(1),
new DividerDrawerItem(),
new SecondaryDrawerItem().withName(R.string.drawer_item_friends).withIcon(FontAwesome.Icon.faw_users),
new SecondaryDrawerItem().withName(R.string.drawer_item_settings).withIcon(FontAwesome.Icon.faw_cog),
new SecondaryDrawerItem().withName(R.string.drawer_item_help).withIcon(FontAwesome.Icon.faw_question_circle))
.build();

最佳答案

移除箭头是一项非常简单的任务。只需通过以下方法禁用它:

withSelectionListEnabledForSingleProfile(false)

https://github.com/mikepenz/MaterialDrawer/blob/develop/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java#L545

抽屉将正方形图像作为Profile图像。如果你想禁用圆形蒙​​版,你可以简单地定义一个不同的蒙版。只需覆盖样式:

<style name="BezelImageView">
<item name="biv_maskDrawable">@drawable/material_drawer_square_mask</item>
<item name="biv_drawCircularShadow">false</item>
<item name="biv_selectorOnPress">@color/material_drawer_primary</item>
</style>

https://github.com/mikepenz/MaterialDrawer/blob/develop/app/src/main/res/values/styles.xml#L28

关于android - 抽屉机器人,删除箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32745609/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com