开发者

How to have an UI component scrolling with my UITableView

I am trying to have a UI component stuck to my cells in a UITableView and scrolling with them... It seems weird but a picture permits to understand the main point:

How to have an UI component scrolling with my UITableView

Before Scrolling

How to have an UI component scrolling with my UITableView

During Scroll

I am trying to do the same effect but with other UI components (another UIVIew). Do you have some hints to do this ?

  • Is it a custom uitableviewcell inserted at start ?
  • Is there an easy-to-implement hack ?

Thanks a lot开发者_开发技巧 for your help !


You can add any UIView and make it scroll with the table cells by placing the UIView in the table header. There is a special property for a table view, called tableHeaderView.

Use something like this:


UIView* my_custom_view;

// TODO: Alloc, and initialize the view

tableView.tableHeaderView = my_custom_view;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜