uicollectionviewcell

UICollectionView - Scrolling to first cell

Deadly 提交于 2019-12-12 07:45:34
问题 I'm making use of UICollectionView and I need to scroll to first cell after click in a button. The button is located in a (big) header section in my collection view... when clicking int it, I need scroll to my first cell located bellow of this button. I created a action of this button, but I don't know how to scroll to first UICollectionViewCell. Can someone help me? 回答1: Use this delegate method, setting the indexPath at the first position: Swift self.collectionView?.scrollToItemAtIndexPath

UICollectionView Custom layout reloading issue in Swift

ぃ、小莉子 提交于 2019-12-12 05:39:00
问题 This is refrence link: https://www.raywenderlich.com/107439/uicollectionview-custom-layout-tutorial-pinterest I have implemented load more in UICollectionView at last cell , the data is getting downloaded, after download complete i want to reload collection collectionView.collectionViewLayout.invalidateLayout() self.collectionView.reloadData() let concurrentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) dispatch_async(concurrentQueue) { DataManager.sharedInstance

Custom UICollectionViewCell properties are null after dequeueing

不羁岁月 提交于 2019-12-12 05:25:04
问题 So I have a UICollectionView and a custom cell and it all shows up and works great. I register the class in viewDidLoad: myCollectionView = [[UICollectionView alloc] initWithFrame:collectionViewFrame collectionViewLayout:layout]; [myCollectionView setDataSource:self]; [myCollectionView setDelegate:self]; [myCollectionView setBackgroundColor:[UIColor myColor]]; [myCollectionView registerClass:[SBCustomCell class] forCellWithReuseIdentifier:@"Cell"]; In my cellForItemAtIndexPath method I

iOS:Setting UICollectionView cell to view size

情到浓时终转凉″ 提交于 2019-12-12 05:20:00
问题 I'm trying to figure out how to setup the frame of the UICollectionView cell to the frame of the view (similar of how photo app) but I need to do it programmatically. Any of you knows how can I do this? I'll really appreciate your help. 回答1: You can use the sizeForItemAt indexPath method on UICollectionViewDelegateFlowLayout . This will determine the size of each cell, and can be configured to be relative to the size of other elements (like your view , for example). func collectionView(_

Collection View Cells not appearing in Collection View?

大兔子大兔子 提交于 2019-12-12 03:46:40
问题 I created a Collection View using purely the storyboard interface builder. This is what the storyboard looks like: My collection view's properties are default as well. I haven't written anything into my ViewController.swift yet. For some reason, when I run on my phone / emulator, none of the buttons are showing. 回答1: Just configure the collectionView properly see below code and image: Implement the delegate methods of collectionView : class yourClassController: UICollectionViewDataSource,

UIProgressView work not correctly when setFrame in UICollectionViewCell

柔情痞子 提交于 2019-12-12 03:29:13
问题 I create a UIProgressView inside UICollectionViewCell, I try to setFrame for UIProgressView to change position in UICollectionViewCell but when do that, some cells not display progressView. When I delete setFrame, It's OK but default width at the top of UICollectionViewCell What's the problem?How to change UIProgressView size, origin? Please help! //Cell:UICollectionViewCell //Cell.m - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { //ProgressView self

Text Blur with UICOllectionview cell

我只是一个虾纸丫 提交于 2019-12-12 02:36:26
问题 I have collectionView Cell In that i have this text,I want to blur the text as shown in image. I have tried Using UIVisualEffect but i didnt get exact response. Code: UIGraphicsBeginImageContext(self.bounds.size); [self.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); //Blur the UIImage with a CIFilter CIImage *imageToBlur = [CIImage imageWithCGImage:viewImage.CGImage]; CIFilter

Disappearing UICollectionViewCells on landscape orientation

心已入冬 提交于 2019-12-12 02:25:35
问题 I have a problem managing my UICollectionsView with flowlayout and orientation. Basically, the problems happens when I switch to landscape, some of the UICollectionViewCells are missing. They reappear once I start scrolling. It should be able to show all the cell since there is so much more room on the contentSize. I even tried in my layout: - (BOOL) shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds { return YES; } With the same results. Anyone have any ideas on this problem? I included

UICollectionView cell size ContentView Issue

天涯浪子 提交于 2019-12-12 02:23:25
问题 I have a UICollectionViewCell in storyboard the cell. The cell size is 45 for first 6 cells and 50 for the last cell. Storyboard cell size has width = 60. The following issue occurs when running on iOS Simulator 4s. If you see the cell at location 2,4,6 there is a red background of UICollectionView. I get the following in layoutSubView of the subclass. Frame = {{0, 0}, {50, 60}} Frame = {{0, 0}, {45, 60}} Frame = {{0, 0}, {45, 60}} Frame = {{0, 0}, {45, 60}} Frame = {{0, 0}, {45, 60}} Frame =

Cell not showing image after loaded from Firebase Swift

走远了吗. 提交于 2019-12-12 00:50:12
问题 I have a UITableViewCell which shows either an image or text. I have set my UIImageView height and width to <= 150 so that it wouldn't affect the cell height in case the image isn't present but the text is. (this is a messaging app) Now my problem is, the cell does not show the image after it's loaded and user needs to go back, and view this screen again in order to see the image. How should i solve this? Before Image is loaded: After the image is successfully loaded: as u can see, it doesnt