uicollectionview

UICollectionView - Update Array indexPath based on Horizontal Scrolling

我的梦境 提交于 2020-01-25 16:18:29
问题 Hi I m using two collection cell to display data, Child Collection view values are based on main Collection View. I have Video List and when i select Video In Table i m passing Complete array at index path, so that the main collection view will be displayed based on selected indexPath of array. it is displaying fine, but when i scroll it horizontal, I an passing visible cell indexPath data to fetch child collection View Data. But when i scroll Main Collection View , The array at indexPath is

UICollectionView - Update Array indexPath based on Horizontal Scrolling

做~自己de王妃 提交于 2020-01-25 16:18:17
问题 Hi I m using two collection cell to display data, Child Collection view values are based on main Collection View. I have Video List and when i select Video In Table i m passing Complete array at index path, so that the main collection view will be displayed based on selected indexPath of array. it is displaying fine, but when i scroll it horizontal, I an passing visible cell indexPath data to fetch child collection View Data. But when i scroll Main Collection View , The array at indexPath is

主流界面搭建原理(类似百思不得姐主界面)

心已入冬 提交于 2020-01-25 10:42:17
1.项目需求 主界面能左右滚动,还能上下滚动,点击按钮跳转界面。 2.分析界面 点击按钮跳转界面可以自定义UITabBarCotroller来实现; 左右滚动,可以利用scrollView来实现 或 UICollectionView; 上下滚动,用tableView可以实现。 3.选择实现方案 方案一:UITabBarCotroller + scrollView + tableView + titleView(TabBar条); UIScrollView弊端:没有做离屏渲染优化; 使用scrollView,没有显示的tableView也会渲染,渲染比较耗内存,创建很多对象; 离屏渲染: 如果一个界面,没有显示到屏幕上,不会渲染,如果在屏幕上,就会渲染; 方案二:UITabBarCotroller + UICollectionView + tableView + scrollView(TabBar条) 能扩展标题; UICollectionView好处:优化离屏渲染,并不是少创建UITableView; tableView添加UICollectionView的cell里面。 4.界面搭建实现步骤 4.1 先创建一个UIViewContriller 。 4.2 创建UICollectionView添加到UIViewContriller的View上面;

How to add a UIPageController and UICollectionViewController to a UIViewController programmatically

試著忘記壹切 提交于 2020-01-24 23:10:28
问题 I already have a UIViewController made programmatically, and would like at the bottom to have a collection view with 4 cells, but I want to be able to swipe through different pages of the collection view to see different cells. I'm not sure where to begin with this wether to enable paging on the collection view and how that would work with setting up the cells, or to create a page controller and adding the collection view to that? There are a couple of ways that I have seen online already,

Ambiguous reference to member 'collectionView(_:layout:minimumLineSpacingForSectionAt:)'

浪尽此生 提交于 2020-01-24 19:19:58
问题 I have found an error in my code that is really annoying me. I coded Swiping View Controller in a separate application and now I am trying to integrate it into this new application. Basically the error is as follows: Ambiguous reference to member 'collectionView(_:layout:minimumLineSpacingForSectionAt:)' here is some of my code, let me know if I need to add more!! extension SwipingController { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout:

UIScrollView delegate methods not calling properly

≯℡__Kan透↙ 提交于 2020-01-24 06:40:30
问题 In order to scroll up and down i need to call two methods for that I have used the below method .I am using scrollview delegate method for UICollection as it is the subview for UIScrollView .Here is the code that I have written but the scroll is not easily moving and the result is also not accurate for some times can any one suggest.? - (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView{ CGPoint mScrollPosition = [scrollView.panGestureRecognizer velocityInView:mCollectionView];

UIScrollView delegate methods not calling properly

我与影子孤独终老i 提交于 2020-01-24 06:38:08
问题 In order to scroll up and down i need to call two methods for that I have used the below method .I am using scrollview delegate method for UICollection as it is the subview for UIScrollView .Here is the code that I have written but the scroll is not easily moving and the result is also not accurate for some times can any one suggest.? - (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView{ CGPoint mScrollPosition = [scrollView.panGestureRecognizer velocityInView:mCollectionView];

Swift: Expand UITableViewCell height depending on the size of the UICollectionView inside it

╄→尐↘猪︶ㄣ 提交于 2020-01-24 04:22:10
问题 Hi everyone. I started learning programming 1 month ago so please be nice if I don't explain my problem well :) My project is composed of a main UITableView . In each cell of the UITableView , I have a UICollectionView (on horizontal scrolling). Img 1 : Main view The width of each UICollectionViewCell is the same as the entire UITableViewCell . My first problem is about sizing the height of the UITableViewCell (which will depend of the size of the UICollectionView itself and the size of the

UICollectionView scroll to item not working with horizontal direction

回眸只為那壹抹淺笑 提交于 2020-01-24 02:17:04
问题 I have a UICollectionView within a UIViewController with paging enabled. For some strange reason collectionView.scrollToItem works when the direction of the collectionview is vertical but doesn't when direction is horizontal . Is this there something I'm doing wrong or is this supposed to happen? //Test scrollToItem func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let i = IndexPath(item: 3, section: 0) collectionView.reloadData() collectionView

Loading UICollectionViewCell one at a time

放肆的年华 提交于 2020-01-24 01:10:10
问题 As per this article http://aplus.rs/2014/how-to-animate-in-uicollectionview-items/ I am trying to load a UICollectionViewCell one at a time to animate the cell when it appears. However, when I call the code the loops the cellCount++, it produces this error: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (1) must be equal to the