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即可实现。

  • 相关阅读:
    预设池(滑雪大冒险)
    随机
    python select模块详解
    轮询、长轮询、长连接、websocket
    Python中的栈溢出及解决办法
    JavaScript中的this的指代对象详解
    Django--缓存、信号、序列化
    SQLAlchemy中的自引用
    Python操作 RabbitMQ、Redis、Memcache、SQLAlchemy
    虚拟机下安装centos7方法,修改系统语言为简体中文的方法
  • 原文地址:https://www.cnblogs.com/KiloNet/p/1808269.html
Copyright © 2011-2022 走看看