uicollectionview

Constraints Removing SegmentController from view

℡╲_俬逩灬. 提交于 2020-01-07 08:35:43
问题 I have a UICollectionView and a SegmentController . The required end result: SegmentController fully in view, UICollectionView beneath it Before adding constraints: After adding constraints (Notice the SegmentController is almost entirely hidden): The Constraints added: ProductsCollection.removeConstraints(ProductsCollection.constraints) SegmentController.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ SegmentController.centerXAnchor.constraint(equalTo: view

New Data Not Updating after Unwind Segue Performed

北慕城南 提交于 2020-01-07 04:44:11
问题 I'm relatively new to Swift and am stumbling on this problem that is likely very simple to fix, I just can't figure it out and keep hitting a brick wall. I'm making an app where a user taps an image in a collection view controller and it performs an unwind segue back to the main view controller and updates a uiimageview with the image that the user selected. I got the unwind segue to work but the problem is that the uiimageview is always one image behind (i.e. I select image A, unwind segue

Duplicated Cell Animation During Batch Update

老子叫甜甜 提交于 2020-01-07 03:40:15
问题 I have set up a collectionView to have custom reordering behavior via the solution here However, when a cell is quickly dragged to a new row, the animation shows the dragged cell animate from its original position again (see below): I am wondering how I could have it just drop the dragged cell at the row it's been dragged to, rather than showing it animate from its original cell again. 回答1: I have solved this well by increasing the setting the dragged cell's layer.speed property when the

Custom Collection view cell in swift

荒凉一梦 提交于 2020-01-06 21:09:09
问题 I am new to iOS development and I am developing a buy/sell application. I am trying to make a collection view where I don't hard set the size of the collection view cell. Instead it would depend on the user who post up something they are selling. I realized that by hard coding the size of the boxes, everything looks "boxy". Any suggestions would be greatly appreciated. 回答1: Assuming you're using the default flow layout, there are two options: You can have self-sizing cells if you: define

UIcollection view not getting call datasources

三世轮回 提交于 2020-01-06 20:37:43
问题 Hello Im creating a UICollectionView from xib. And this is my .h class @interface ArtistViewController : <UIViewController<UICollectionViewDataSource,UICollectionViewDelegate> @property (retain, nonatomic) IBOutlet UICollectionView *collectionview; in my .m ViewDidloadmethod I did this [collectionview setBackgroundColor:[UIColor clearColor]]; My data sources and delegates are like this - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {

UIcollection view not getting call datasources

五迷三道 提交于 2020-01-06 20:37:39
问题 Hello Im creating a UICollectionView from xib. And this is my .h class @interface ArtistViewController : <UIViewController<UICollectionViewDataSource,UICollectionViewDelegate> @property (retain, nonatomic) IBOutlet UICollectionView *collectionview; in my .m ViewDidloadmethod I did this [collectionview setBackgroundColor:[UIColor clearColor]]; My data sources and delegates are like this - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {

UIcollection view not getting call datasources

安稳与你 提交于 2020-01-06 20:36:10
问题 Hello Im creating a UICollectionView from xib. And this is my .h class @interface ArtistViewController : <UIViewController<UICollectionViewDataSource,UICollectionViewDelegate> @property (retain, nonatomic) IBOutlet UICollectionView *collectionview; in my .m ViewDidloadmethod I did this [collectionview setBackgroundColor:[UIColor clearColor]]; My data sources and delegates are like this - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {

Create a gallery for local app content in iOS

旧时模样 提交于 2020-01-06 19:33:51
问题 My app takes some videos and pictures and stores them in the Application Home/Documents folder. I want to create a gallery that will open and display (and playback) these items. I looked into MPMediaPickerController and it looks like the only option for data source there is the Photos Album. It looks like I will have to go with creating UICollectionView. Is this the right way to do this or is there another way similar to MPMediaPickerController but with setting the source to an array of data

UICollectionView multiple Selection Reusability issue

有些话、适合烂在心里 提交于 2020-01-06 17:41:31
问题 I am new to UICollectionview. I have made a simple sample were I can apply multiple selection of image. but I'am getting issue regarding selection, the issue is when I scroll collection view the check mark are added to other cells and the images array count is different at didSelectedItem and didDeselectItem . Here is the sample code which i have tried Sample Link 回答1: When you scroll in a CollectionView (or a in TableView for that matter), the cells are reused. To keep the selection while

How to Save Data and Segue Back to Collection View?

别来无恙 提交于 2020-01-06 16:17:50
问题 tl;dr: I'm having trouble figuring out how to segue from my NewTransactionViewController back to my main CollectionViewController and when going back, adding the data from the NewTransactionViewController into my collection list view. What I've found online is either too basic for what I need or too sophisticated. Essentially I'm trying to mimic a UITableView but I'm using collections for more dynamic capabilities later on (plus I want the option of multiple columns). I'm new to programming