zoukankan      html  css  js  c++  java
  • Creating a combo box for the iPhone(思路)

    In a view controller you have a UITextField and a UITableView. Assign the view controller to be the delegate of the both controls, plus the data source of the table.

    Implement the UITextField delegate methodtextField:shouldChangeCharactersInRange:replacementString: in your controller. This intercepts the changes as they are being typed in your text field. In this method, iterate through your list of possible options and store the matches in an NSMutableArray instance variable on your view controller. Then call [myTableView reloadData].

    Have your table cells generated from the array of matches you previously stored.

    It should be pretty straightforward and shouldn't take much code at all beyond a few delegate methods to get working.

    UITextField + UIButton + UITableView即可实现。

  • 相关阅读:
    windows 环境下 eclipse + maven + tomcat 的 hello world 创建和部署
    使用IntelliJ IDEA 14和Maven创建java web项目
    使用Spring JDBCTemplate简化JDBC的操作
    CSS颜色代码 颜色值 颜色名字大全
    mysql创建数据库命令
    win64位安装python-mysqldb1.2.3
    UVA11426 欧拉函数
    关于gcd的几个问题
    POI2007_zap 莫比乌斯反演
    BZOJ2005 莫比乌斯反演
  • 原文地址:https://www.cnblogs.com/KiloNet/p/1808269.html
Copyright © 2011-2022 走看看