EditText onClickListener in Android

后端 未结 14 2142
时光取名叫无心
时光取名叫无心 2020-12-02 12:03

I want an EditText which creates a DatePicker when is pressed. So I write the following code:

    mEditInit = (EditText) findViewById(R.id.date_init);
    mE         


        
14条回答
  •  没有蜡笔的小新
    2020-12-02 12:23

    IMHO I disagree with RickNotFred's statement:

    Popping a dialog when an EditText gets focus seems like a non-standard interface.

    Displaying a dialog to edit the date when the use presses the an EditText is very similar to the default, which is to display a keyboard or a numeric key pad. The fact that the date is displayed with the EditText signals to the user that the date may be changed. Displaying the date as a non-editable TextView signals to the user that the date may not be changed.

提交回复
热议问题