Home > Mobile >  IOS science problem,
IOS science problem,

Time:09-24

Recently in the maintenance of the project encountered some wonderful work, their study, but did not resolve, to do a record, by Daniel still hope, an idea;
This again, describe the problem, for everybody discussion


1. MJRefresh layout problems

ViewController. There are two and the self View the size of the View. One is added MJRefresh mj_header TableView a UIScrollView, in self. There is a button in the View will be according to the state of the button to judge which one shows the View, using the method of removeAllViews, remove the self. The View of all the View for beginning the method implementation, found after the jump to UIScrollView back with refactoring, MJRefresh. Mj_header will continue downward migration, namely TableView contentOffset. Y is larger;


2. The problem of UICollectionView sliding

UICollectionView believe everyone used, UICollectionView set the horizontal scroll and set the page effect, in collectionView: (UICollectionView *) collectionView cellForItemAtIndexPath: (NSIndexPath *) indexPath method in print indexPath. The item you will find the item subscript corresponds with the current display item, slide from left to right when the subscript is added 1, from right to left, the subscript is much reduced 1;

Problems recorded at passing by the great god has encountered, also show just a little, please

CodePudding user response:

The first question don't know what is in the description
The second question:
This is a collection veiw cell reuse mechanisms, the next to show to load in advance

CodePudding user response:

The first question is for MJRefresh inside the ViewController to remove all child views after rebuilding the UIScrollView or tableView and then add refresh class will refresh the text offset problems
The second problem is that when using can not sliding and since the current cell index matching problem
  •  Tags:  
  • iOS