【问题标题】:Validate the custom list view controls验证自定义列表视图控件
【发布时间】:2013-12-25 18:19:05
【问题描述】:

我是android开发的新手 这是我的问题 我创建了一个由文本视图和编辑文本组成的自定义列表视图

如何验证自定义列表视图中的所有编辑文本是否已填充,然后仅启用接受按钮?

【问题讨论】:

  • 向我们展示你迄今为止所拥有和尝试过的东西......这个问题没有多大意义......

标签: android-listview


【解决方案1】:

我在 getView() 方法中为 Edittext 添加了文本观察器 并且在 public void afterTextChanged(Editable s) {

        View v;
        EditText et;
        ListView listView = (ListView) findViewById(R.id.listView1);
        Button acceptButton=  (Button) findViewById(R.id.Loginbutton);
        for(int i=0;i<listView.getChildCount();i++)
        {
            v = listView.getChildAt(i);             
            et = (EditText) v.findViewById(R.id.txtedt);
            // and then i got the entered edittext values and make enable/disable the acceptButtton on the bases of Edittext values.

        }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多