如何删除重点从单一的EDITTEXT [英] How to remove focus from single editText
问题描述
可能重复:
<一href="http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup">Stop从的EditText在活动启动时获得焦点?
在我的应用程序有一个单一的EditText连同一些TextViews,按钮和微调。我的EditText接收焦点,因为它是本次活动的唯一可获得焦点来看,我相信。我的EditText显示有橙色边框和光标在球场上。
现在,我想从这个领域(我不希望光标和边框显示)删除焦点。有没有办法做到这一点?
我已经能够做button.seFocusableInTouchMode()和button.requestFocus()把重点放在按钮。但是,这凸显了按钮,显然不是我想要的。
In my application I have a single EditText together with some TextViews, button and a spinner. My EditText receives focus since it is the only focusable view in this activity, I believe. My EditText shows with an orange border and cursor on the field.
Now I would like to remove the focus from this field (I don't want the cursor and border to show). Is there a way to do this?
I have been able to focus on the button by doing button.seFocusableInTouchMode() and button.requestFocus(). But this highlights the button and is obviously not what I want.
推荐答案
检查这个问题,并选择答案:<一href="http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup">http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup这是丑陋的,但它的工作原理,而据我所知,有没有更好的解决办法。
check this question and the selected answer: http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup It's ugly but it works, and as far as I know there's no better solution.
这篇关于如何删除重点从单一的EDITTEXT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!