开发者

UITableview is not scrolling if less tableviewcell

I am trying to scroll tableview even there is no data at initial. to track - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView

If there are more rows than visible area of UITableView cell, then only scrolling (vertically) is enable. but I'm trying table, in which there will be zero row at begining.

Note * I had placed UITableView from IB

in https://github.com/leah/PullToRefresh , it is working even there are less rows.

but one weird thing is, if I get back to view (contains UITableView contains 开发者_StackOverflowless row) , now it works even after less row.

Please let me know, if anybody doesnot understand my problem


I don't want to take any credits by myself. all credit goes to Vince

If I set Bounces property of UITableView on IB, it is not actually setting YES for less rows,

after I do,[self.table setBounces:YES];on viewDidLoad , scroll is enable even if there is no rows, ;)

thank you vince again,


If you are looking for that bounce effect where you can drag on the table and it rubber bands a bit you can set myTable.alwaysBouncesVertical = YES; If you are looking for the ability to actually scroll with blank cells showing up you will have to actually specify blank cells in your cellForRowAtIndex: method.


From your message and comments, I am interpreting that you want to enable scrolling on a UITableView when the number of cells is equal to 0.

Let me attempt to answer your question with a question: What are you scrolling if there are 0 cells?

The reason the scroll does not work is because there is no content to scroll. Your UITableView, when it has 0 cells, will not scroll because it has nothing to replace the data that you're trying to move.

"Why I want to make enable is, I want to refresh table same like in facebook app if user scroll downs UITableView" This is not default functionality for a UITableView. This is custom functionality that has to be programmed, this is why the app is not doing what you expect it to be doing.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜