uicollectionview

UICollectoinView horizontal scroll with inter item spacing

六月ゝ 毕业季﹏ 提交于 2020-01-11 03:13:46
问题 I am using a collection view for some of my images. Each image should be displayed at the size of the screen, therefore one cell has the width of the screen. The minimumInterItemSpacing of the flowLayout is 25. So now the problem is, that if I am scrolling, the collection view doesn't scroll to the start of the next image, but to the start of the interItemSpacing. Let's give me an example: Image/Cell width = 320 CollectionView's interItemSpacing = 25 If I scroll one page, the scroll view

UICollectionViewLayout layoutAttributesForElementsInRect and layoutAttributesForItemAtIndexPath

↘锁芯ラ 提交于 2020-01-11 00:08:33
问题 I'm implementing a custom flow layout. It has 2 main methods for overriding to determine placement of cells: layoutAttributesForElementsInRect and layoutAttributesForItemAtIndexPath . In my code, layoutAttributesForElementsInRect is called, but layoutAttributesForItemAtIndexPath isn't. What determines which gets called? Where does layoutAttributesForItemAtIndexPath get called? 回答1: layoutAttributesForElementsInRect: doesn't necessarily call layoutAttributesForItemAtIndexPath: . In fact, if

How to create a layout like Featured page in App Store?

♀尐吖头ヾ 提交于 2020-01-10 19:41:11
问题 I'm new in iOS development. Based on my assumption, Feature page in App Store was created using a combination of UITableView and UICollectionView. But how to do that in theory and code? I know it's a bit vague, because it's quite hard to describe it, but I just need some people to help me explain it. For this case I will try to use these naming: 1. Top section, it's a view which showing banners of apps, people can swipe it to view another banner. 2. Middle section, views which can be scrolled

iOS: Adding UITapGestureRecognizer to container view intercepts UICollectionView's didSelectItemAtIndexPath method

亡梦爱人 提交于 2020-01-10 19:27:09
问题 I added a UITapGestureRecognizer to my main Content View in my ViewController to dismiss my keyboard when the content view is tapped. The problem is that I have a UICollectionView inside my content view, and setting the UITapGestureRecognizer intercepts the taps of my UICollectionView . How do I allow my UICollectionView 's taps to go through so that the didSelectItemAtIndexPath method will fire again? func setupGestureRecognizer() { let dismissKeyboardTap = UITapGestureRecognizer(target:

UICollectionReusableView - Missing return in a function

纵饮孤独 提交于 2020-01-10 18:14:12
问题 I had a weird problem running into considering a header of a UICollectionView . I basically used the code from: http://www.raywenderlich.com/78551/beginning-ios-collection-views-swift-part-2 func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView { let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "dd.MM.yyyy' - 'HH:mm'" //1 switch kind { //2 case

How do I create a UICollectionView with column and row headers?

半世苍凉 提交于 2020-01-10 09:22:13
问题 I want to create a UICollectionView that looks like this: It won't be scrollable or editable. I'm currently wondering how to write the layout for this. I'm guessing it won't be a subclass of UICollectionViewFlowLayout . I can think of a number of ways, but was curious if there was any "right" way. The cells will be animate-able. Should each row or column be its own section? 回答1: I've done something like what you want with a subclass of UICollectionViewFlowLayout. It looks like this,

Swift: how to make a ScrollView work with PageControl?

风流意气都作罢 提交于 2020-01-10 04:26:06
问题 Strctly following this tutorial, in section Paging with UIScrollView , I have just implemented a ScrollView to use as a slideshow with downloaded photos from a previous UICollectionViewController . When scroll view is loaded, it does not work well because I see these ones: Instead, when I slide back the images they are displayed in the correct way, one for each page. Or better, this problem disappears when I get the 4-th image in the slideshow, and only at that point all the following ones

Delete cell from UICollectionView without reloading from top [closed]

百般思念 提交于 2020-01-09 09:04:11
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I am using a CollectionView in my ios app. Each collection cell contains a delete button. By clicking the button the cell should be deleted. After deletion, that space will be filled with below cell (I don't wish

Delete cell from UICollectionView without reloading from top [closed]

 ̄綄美尐妖づ 提交于 2020-01-09 09:04:09
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I am using a CollectionView in my ios app. Each collection cell contains a delete button. By clicking the button the cell should be deleted. After deletion, that space will be filled with below cell (I don't wish

Delete cell from UICollectionView without reloading from top [closed]

↘锁芯ラ 提交于 2020-01-09 09:02:43
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I am using a CollectionView in my ios app. Each collection cell contains a delete button. By clicking the button the cell should be deleted. After deletion, that space will be filled with below cell (I don't wish