I am creating a UICollectionView with paging enabled. Each collection view cell is a full screen image. By default I am able to view the cells from the index 0 (first cell). But I want to start viewing cell from a particular cell index. Can anybody tell me how to do that?
Got it working.
From the first view controller pass the index path of photo to which you have to scroll. In the ViewDiDLoad of your collection view set up the collection view and then use the method - scrollToItemAtIndexPath:atScrollPosition:animated: Set animated to NO and atScrollPosition to UICollectionViewScrollPositionNone
Related
I am looking for a possibility to drag and drop an image in a collection view cell to a UIImageView in the same view controller but outside of the collection view. The cv is below 5 collection views and i want to drag the image in the collection view and drop it into one of the 5 UIImage Views above the collection view. Is there a possibility to take the image from the collection view cell and reorder the collection view in new order so that the token dragged image (and cv-cell) will be deleted below? The images in the colectionview come from urls via json load. I am working with storyboard and with ARC ...
Thanks a lot for any help or tipps!
Maybe you could load the images of the collection view inside an NSMutableArray, which you can run through in order to get the data your collection view must show. When you drag it from the collection view into the UIImageView, remove the correspondent index of that image inside the NSMutableArray and reload the collection view data. At the same time you get that image data and load it to the image view. This could help if I understood your problem.
I have a view controller that I have a static view up at the top with a button and a tableview that is under it. I'm attempting to create custom cells in the tableview, but I cannot add labels or anything to the cell. Storyboard only allows me to add the labels to the original view or the tableview (but not the cell). How can I get around this?
Here's a picture for reference.
Out of pure "trying everything" I got it fixed by manually dragging a cell into the view and not using the auto generated prototype cells by xcode. It looks like it was a bug with xcode where it's auto generated prototype cells would not let any interaction happen. To fix it, I dragged a UITableView cell from the object list into the tableview and I was able to edit that just fine. Hope this helps someone else out.
In one of my ViewControllers, I added a tableview as a subview.
In this tableView I made implemented custom table view cell, which contains a remove button init.
So, when I clicked the remove, the data related is deleted, but the row in the tableview remains, it will disappear, when I reload my APP.
Can anyone help me out..
You have to use this method from UITableView:
- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
The index path is the index of the row to remove.
I have an NSTableView bound to an NSArrayController which fetches some entries from core data.
I would like to have a custom view cell in the bottom of that NSTableView so that when the user scrolls to the last element in the table, a scrolling indicator will appear instead of a table view cell.
This is similar to what happens in the twitter for mac application, where you scroll to the bottom of the list to fetch more results.
Because the binding is done in the nibs, I'm not quite sure if I need to change that and set the NSTableView datasource to my windowcontroller and increase the number of rows with 1.
Is there a simple way to do this?
I'm using a tableview to display a list of rows and when selected, I want additional controls to appear right below the cell, probably in another view which I will control.
So far, I've managed to get a reference to the selected cell by running through the visiblecells array in the tableview but the frame property always returns a y-coordinate of 0 no matter what scroll position the table is in.
How do I get the position of the cell relative to the window?
I think the best way to deal with table views is in their own terms. That is, if you want to position something new inside the table, put it in a cell. It sounds like you want to subclass UITableViewCell to make your controls, and go through the whole tableView beginUpdates - insertCells - endUpdates process to animate their appearance.