久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

用戶點擊我的 EditText 后如何做某事

How to do something after user clicks on my EditText(用戶點擊我的 EditText 后如何做某事)
本文介紹了用戶點擊我的 EditText 后如何做某事的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個顯示時間的 EditText.用戶單擊 EditText 后,我想顯示一個 TimePickerDialog,因此我將 View.OnClickListener 設置為我的 EditText.

I have an EditText that shows time. After user clicks the EditText I want to show a TimePickerDialog, so I set a View.OnClickListener to my EditText.

但是 OnClickListener 的行為很奇怪 - 我觸摸 EditText 然后出現軟件鍵盤(我不想要).當我再次觸摸時, OnClickListener.onClick() 終于被調用并出現對話框.

But the OnClickListener is behaving weirdly - I touch the EditText and then software keyboard appears (which I don't want). When I touch again, OnClickListener.onClick() is finally called and the dialog appears.

如果我想讓對話框立即出現怎么辦?

What should I do if I want the dialog to appear immediately?

推薦答案

與大多數其他控件不同,EditText 在系統處于觸摸模式"時是可聚焦的.第一個單擊事件聚焦控件,而第二個單擊事件實際上觸發 OnClickListener.如果您使用 android:focusableInTouchMode View 屬性禁用觸摸模式焦點,則 OnClickListener 應該會按預期觸發.

Unlike most other controls, EditTexts are focusable while the system is in 'touch mode'. The first click event focuses the control, while the second click event actually fires the OnClickListener. If you disable touch-mode focus with the android:focusableInTouchMode View attribute, the OnClickListener should fire as expected.

<EditText
        android:text="@+id/EditText01"
        android:id="@+id/EditText01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:focusableInTouchMode="false" />

這篇關于用戶點擊我的 EditText 后如何做某事的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

EditText: Disable Paste/Replace menu pop-up on Text Selection Handler click event(EditText:禁用文本選擇處理程序單擊事件上的粘貼/替換菜單彈出)
Multiline EditText with Done SoftInput Action Label on 2.3(2.3 上帶有完成 SoftInput 操作標簽的多行 EditText)
How to detect the swipe left or Right in Android?(如何在 Android 中檢測向左或向右滑動?)
Prevent dialog dismissal on screen rotation in Android(防止在Android中的屏幕旋轉對話框解除)
How do I handle ImeOptions#39; done button click?(如何處理 ImeOptions 的完成按鈕點擊?)
How do you set EditText to only accept numeric values in Android?(您如何將 EditText 設置為僅接受 Android 中的數值?)
主站蜘蛛池模板: 亚洲第一天堂 | 亚洲日韩中文字幕一区 | 欧美亚洲另类丝袜综合网动图 | 日韩毛片免费看 | 日韩高清一区二区 | 国产日韩欧美在线一区 | 三级免费网 | 欧美日韩视频在线第一区 | 色综合国产 | 色www精品视频在线观看 | 亚洲欧美日韩电影 | 99re在线| 免费在线黄 | 天天澡天天狠天天天做 | 国产大毛片 | 亚洲国产成人精品女人久久久 | 国产亚洲欧美在线视频 | 毛片毛片毛片毛片毛片 | 亚洲在线日韩 | 欧美午夜精品久久久久免费视 | 日韩欧美国产综合 | 国产99久久| 国产精品日韩欧美一区二区三区 | 99精品99| 97人人草 | 国产精品一区二区久久 | 国产一区 | 91大神xh98xh系列全部 | 97精品国产97久久久久久免费 | 99综合 | 精精久久| 国产在线精品一区二区 | 日韩高清成人 | 日韩精品视频中文字幕 | 国产精品久久久久久久久久妇女 | 99爱国产 | 亚洲啪啪 | 久久99精品国产自在现线小黄鸭 | 亚洲国产精品久久久久婷婷老年 | 爱爱视频在线观看 | 91热爆在线观看 |