导航栏后退按钮自定义图标? [英] Navigation bar back button custom icon?

查看:96
本文介绍了导航栏后退按钮自定义图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过编程方式更改导航栏(以下图像供参考)后退按钮图标?假设在某个时刻,我想将其更改为向下箭头图标(通常用于隐藏软输入),然后在经过用户互动后将其更改回默认值.

Is it possible to change the navigation bar (image bellow for reference) back button icon programmatically? Let's say in a certain moment I'd like to change it to be the arrow down icon (normally used to hide the soft input) then change it back to the default after some user interaction.

推荐答案

我最终要做的是在软输入上创建一个弹出窗口,并使软输入向下箭头"按钮实现我在该弹出窗口上想要的功能. 为了控制软输入的向下箭头"按钮,我必须创建一个extends EditText并覆盖的类:

What I ended up doing was creating a popup window over the soft input and making the soft input "arrow down" button do what I wanted on that pop up window. To control what the soft input "arrow down" button does I had to create a class that extends EditText and override:

public boolean onKeyPreIme(int keyCode, KeyEvent event)

这篇关于导航栏后退按钮自定义图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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