logo
down
shadow

UICollectionViewCell disappears in iOS 8


UICollectionViewCell disappears in iOS 8

By : Irv Singer
Date : November 19 2020, 03:59 PM
I wish this help you I don know How it can be cause of the issue but it was originated from:
code :
NSIndexPath *visibleIndexPath = [self.collectionView indexPathForItemAtPoint:midPoint];
//*****updating page control*****
// get the visible rect
CGRect visibleRect = (CGRect) {.origin = self.collectionView.contentOffset,
    .size = self.collectionView.bounds.size};
// get the mid point in the visible rect
CGPoint midPoint = CGPointMake(CGRectGetMidX(visibleRect), CGRectGetMidY(visibleRect));
// find indexPath of the item in that midPoint
 //in iOS 8 Cause the second cell disappear
//NSIndexPath *visibleIndexPath = [self.collectionView indexPathForItemAtPoint:midPoint];
//iterating through visble cells to find the cell which contains midpoint then get get that cell indexpath
for (UICollectionViewCell *cell in [self.collectionView visibleCells]) {
    if (CGRectContainsPoint(cell.frame, midPoint)) {
        NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell];

        //update page control
        self.pageControl.currentPage = indexPath.row;
        //quiting loop
        break;
    }
}


Share : facebook icon twitter icon
How to tell when a UICollectionViewCell disappears

How to tell when a UICollectionViewCell disappears


By : JimmyJJohnson
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , Delegate method: collectionView:didEndDisplayingCell:forItemAtIndexPath:
But you should probably just create a custom cell and reuse instead of creating and destroying...
UICollectionViewCell disappears while scrolling

UICollectionViewCell disappears while scrolling


By : Dileep
Date : March 29 2020, 07:55 AM
it should still fix some issue I'm using a uicollectionview to create a carousel like scroll view. I think the uicollectionview is the best approach with this use case. I was able to render uicollectionviewcell inside uicollectionview but the problems is, when I scroll the uicolectionview the later cells will disappear and all the cells went black in the end. Another issue is that the cell is not loaded until it's boundary is fully inside the Carousel. , remove this line due to you should not change frame for cell
code :
cell.frame = CGRectMake(indexPath.item * WIDTH + 4, 0, WIDTH, 133.3);
 -(void)loadImageWithURL:(NSURL *)url successBlock:(void (^)(UIImage *image, id itemId))successBlock failureBlock:(void (^)(NSError *error))failureBlock
UICollectionViewCell Remote Image Disappears on Scroll

UICollectionViewCell Remote Image Disappears on Scroll


By : Ryan Y
Date : March 29 2020, 07:55 AM
it should still fix some issue Try this.. -> Remove setImage method from strickerCell class. -> Implement this
code :
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
    let cell: StickerCell = collectionView.dequeueReusableCellWithReuseIdentifier("stickerCell", forIndexPath: indexPath) as! StickerCell
let sticker = stickers[indexPath.row]

if let image = sticker["images"]["medium"].string {
     let url = NSURL(string: image)
    cell.stickerImage.contentMode = .ScaleAspectFit
    cell.stickerImage.clipsToBounds = true
   cell.stickerImage.sd_setImageWithURL(url, placeholderImage:placeHolderImage, completed: { (image, error, cacheType, url) -> Void in
   cell.stickerImage.image = image
    })
}

    return cell
}
UICollectionViewCell: can I know exactly when the cell appears and disappears?

UICollectionViewCell: can I know exactly when the cell appears and disappears?


By : Angie
Date : March 29 2020, 07:55 AM
wish helps you I need to do some animation in a UICollectionViewCell, and I want to start the animation when the cell appears and stop/pause it when it disappears. , try using
code :
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell  forItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath;
UICollectionViewCell border disappears when layer.borderColor is set

UICollectionViewCell border disappears when layer.borderColor is set


By : Guille Garcia Pruden
Date : March 29 2020, 07:55 AM
hop of those help? The problem you are facing is that you are using Boolean Value for layer.borderColor you must to use Color instead. But anyway this don't work because for layer.borderColor you need a cgColor so I think you need define a @IBInspectable var for borderColor and do this in code
code :
@IBDesignable open class ReleaseSpineCell: UICollectionViewCell {

    public var masterRelease: MasterRelease? {
        didSet {
            artistName = masterRelease?.artistName
            title = masterRelease?.title
            catalogNumber = "none"
        }
    }

    @IBInspectable public var artistName: String? {
        didSet {
            artistLabel?.text = artistName
        }
    }

    @IBInspectable public var title: String? {
        didSet {
            titleLabel?.text = title
        }
    }

    @IBInspectable public var catalogNumber: String? {
        didSet {
            catalogLabel?.text = catalogNumber
        }
    }

    //added this inspectable property
    @IBInspectable public var borderColor: UIColor? {
        didSet {
            self.layer.borderColor = borderColor!.cgColor
        }
    }

    @IBOutlet private weak var artistLabel: UILabel?
    @IBOutlet private weak var titleLabel: UILabel?
    @IBOutlet private weak var catalogLabel: UILabel?

}
Related Posts Related Posts :
  • Axis change of stackView giving layout error
  • How to use AVAssetResourceLoader?
  • How to write block definition using properties?
  • iOS connect/reconnect to Bluetooth device when using external-accessory and MFi
  • Saving XMPP Multi User chat messages through XMPP MessageArchiving in iOS
  • Deciding iOS version: pros and cons
  • iOS: Resigned app cannot access keychain through security API
  • How can I set To and Subject fields in an E-Mail being sent by UIDocumentInteractionController?
  • Updating uilabel in view controller underneath another
  • Maximum time Intervel for NSTimer
  • Delete Core Data Entry from Table View Controller
  • How to unload UIViewcontroller from memory?
  • Compressing UIImage as Far as Possible?
  • Optimizing workflow to update internally owned cocoapods dependencies?
  • Formatting an NSDate with Abbreviated Month/Day Names
  • I'm creating a quiz game with 4 answers and I want to add score
  • Tap Gesture to Hide Navigation Bar, Tab Bar, and Status Bar
  • FBSessionStateClosedLoginFailed when I am logged in through Settings
  • CGRect positioning according to center point
  • iOS: Update table view datasource with animations without core data
  • iOS : Where to start for AliPay integration?
  • Routing App Coverage File missing but not needed?
  • Drawing on a zoomable view
  • Append NSStrings and NSNumber to NSMutableArrays and make NSMutable dictionary
  • Terminating app due to uncaught exception 'NSRangeException' when calling dequeueReusableCellWithReuseIdentifier:forInde
  • Collision without physics (Cocos2D + Box2D iOS)
  • Creating a percentage based iOS layout
  • Update tableView row from AppDelegate Swift 4
  • Assigning return value of a class method to a variable error
  • how to display circular progress in delphi ios apps?
  • I can't figure how to fix this Expected identifier or '('
  • How to Test APIs in Swift 4?
  • Link error /Build/Products/Debug-iphonesimulator file not found
  • working with a very large JSON object in iOS
  • Turn off part of the iPhone Screen
  • Phonegap 3.0 app with facebook login using xCode
  • How to add interstitial admob ads to my ios project
  • adding tapku calendar to ios app
  • Add an alertcontroller in a global swift file?
  • Take square image with Cordova (Phonegap) Camera API?
  • Amazon S3 policy allowing only upload not overwrite
  • How to change the UILabel content by tapping?
  • Adding checkmark to selected table cell also checks another table cell
  • UICollectionView cellForItemAtIndexPath indexPath row is nil
  • Resize and set quality on JPEG image while retaining EXIF in iOS
  • How to push rootviewcontroller in Ios
  • How to add UIBarbuttonItem at centre on UInavigationbar in iOS
  • Would this IOS device test crash be expected
  • PickerView not showing any values
  • How to set root view controller in storyboard animated with navigation controller programmatically
  • Can anyone suggest me the effective way to deal with s3 upload fail because of timezone difference issue?
  • Getting list of files in documents folder
  • Error while using Realm Object as a singleton. Is it a good idea?
  • inserting into SQLite database
  • More nodes than I should
  • Facebook IOS SDK navigate to another controller after login not working
  • Swift Array - use "Contains" of type AnyObject
  • Sidebar menu with indicate navigationbar on iOS
  • Programmatically set size of UIView from Storyboard
  • Navigation bar blink
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org