I have a tableview in a collectionView having 5 sections and each section has 10 rows. Each cell has to be given different images.I am new to ios and have very less idea on this.
Design A custom tableviewcell with a Image View, in Tableview's datasource Method -cellForRowAtIndexpath : assign image on imageView as you wish.
Related
I'm working on ui that has basically two categories first is categories and second one is products when user click on any category the products load accordingly.Category showing in horizontal direction and products showing in vertical direction.I'm using tableView and inside the tableView cell I'm using two collectionViews.All outlets are connected when I running code (could not dequeue a view of kind: UICollectionElementKindCell with identifier CategoiresCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard") occurs.Also I'm using tableView height method I' want dynamically calculated and also in collectionView I'm using sizeForItemAt for calculating the height so how I can calculate the dynamically height accordingly to content in tableView as well as in collectionView according to tableViewcell.
I want this layout
My code pics
Error:
We have had the had the same problem with sizing of TableViewCell and dealing with accessibility large font and collection views, the way we got around that was to get the table view cells to to relayout there contents a second time, it seem like the cell needs to layout there subview again with something like layoutIfNeeded, it was a work project, so I don't have access to anymore and can only go by memory, but hopefully this will point you in the right direction.
I have a UiView that contains a CollectionView for images of a kind of products and a TableView that contains cells with images and labels of another kind of products.
What I'm trying to do is give this UIView a scroll, showing of the images of the first CollectionView unfolded, and scrolling down show all the TableViewCells unfolded, not with his own scroll in their section.
I have tried embedding the two sections into a scrollView but this doesn't worked.
What could I do?
Any reason why you picked a UIView instead of a UIScrollView? Seems like a scrollview would solve your problem.
I just need a suggestion to Implement tableView for the application.
According to reference image is this a collectionView used in tableView?
Actually I want to implement 4 views on the top of the tableView something like Reminder app of apple. Obviously not to copy design but I need 4 views within UITableView.
These 4 views are also scrollable as its the part of tableview.
I am confused in this how can I achieve this design image attached.
my main concern is 4 top views tile style.
Image
In your case you may better use tableHeaderView property of UITableView and set your "reminder" view as tableHeaderView:
self.tableView.tableHeaderView = myReminderView
If you need to implement it as a cell, for some reasons, just create a custom UITableViewCell subclass and add UICollectionView with all DataSources/Delegates implementations you need inside this cell class.
I have a custom table cell having a uiview and 3 labels. on the uiview there is an imageview. i am detecting touch and on the uiview/imageview. on touchesended method i am changing the image of the imageview on this uiview.now after running the program 7 rows are visible on the table. if i touch on the imageview of 1st row, the image gets changed. Now if i scroll the table, the image of the imageview on row 9th also gets changed itself. Can any one pls help me out whats getting wrong?
if you use reusable cells, after scrolling the table view will consume the same cells you've set up in the cellForRowAtIndexPath method. So it might be that the cell for row 1 and for row 9 use the same cell object. That explains, that when you change something in row 1 cell, the row 9 cell will be changed in the same way. Just be sure, that when you setup your reusable cells to nil the image of your uiimageview, or feed it with a proper image.
Can you place more than one image in a UITableViewCell?
Yes.
You can have 2 images per cell, without customizing.
imageView
accessoryView
You can also add images to the contentView.
The standard UITableViewCell only supports one image (via the imageView.image property).
However, you can make a custom subclass of UITableViewCell and add the desired number of image views.
The simplest way would be to set a custom view (with any number of images) as the cell's contentView.
You could create a custom view and set it as the cell's contentView property. AppleĀ“s Table View Programming Guide for iPhone OS explains in good detail possible strategies for customization of an UITableViewCell.