自定义实现中的 Android 工具栏 "Up"箭头

标签 android android-actionbar android-navigation android-toolbar

我正在制作一个非常自定义的工具栏(不要 panic ,这是好的,我保证),我想放置“向上”箭头(当有父 Activity 集时出现的箭头或出于其他原因,并且在自定义位置对 Lollipop 有很好的波纹触摸效果)。

有没有办法让这个箭头作为 View 或 Assets 在工具栏的其他地方使用?

我什至找不到箭头的图像资源。有什么想法吗?

举个例子,我希望 top 能够做类似的事情:

mToolbar.addView(arrowView, 0);
mToolbar.addView(titleView, 1);

最佳答案

也许 this会有所帮助,看起来像你想要的东西,或者你想要完全自定义具有不同位置和 View 的按钮?

关于自定义实现中的 Android 工具栏 "Up"箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27514819/

相关文章:

Android导航组件+登录流程+嵌套BottomNavigationView

android - SharedPreferences.getInt() 导致 ClassCastException - 为什么?

java - Action 按钮显示为溢出

android - 上下文操作模式与 float 菜单

android - 导航组件 : parcelable argument but get error Type mismatch: inferred type is Student but String was expected

平板电脑的 Android fragment 导航 - 单个或多个 Activity ?

java - Google 示例通用音乐播放器构建错误

android - 创建 Tendermint 私有(private) LAN 区 block 链并访问它

android - 工具栏上的后退箭头方向错误

android - 导航错误 - 此导航图未引用任何布局文件?