Kemal Can Kaynak
Kemal Can Kaynak

Reputation: 1660

How can i hide/show images while scrolling in UITableView?

I'm new to iOS programming and i want to learn something about UITableView.

I have some images in UITableViewCell. I want to hide my images when scrolling start then i want to show them when scrolling stop.

How can i do that ? Is there a method or something else about that ?

Upvotes: 1

Views: 723

Answers (2)

Benny Dalby
Benny Dalby

Reputation: 182

UITableView inherits from UIScrollView, thus you can in your tableView delegate receive UIScrollViewDelegate callbacks.

Implement the delegate method

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView

which tells the delegate when the scroll view is about to start scrolling the content.

and

- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset

which tells the delegate when the user finishes scrolling the content.

Read the ScrollViewDelegate Reference.

Upvotes: 2

Sishu
Sishu

Reputation: 1558

It is not a big deal you simply need to implement scrollview delegated methodes to know when scrolling stops ,Then set a bool value and reload the table and on basis of bool value you can show and hide the images.When scrolling starts set bool to NO.

Upvotes: 1

Related Questions