How to change size of UICollectionViewCell inner elements? - objective-c

I've got a UICollectionView with 3 custom views inside each UICollectionViewCell. I need to make these 3 views bigger in one cell, but I couldn't find a way to access size properties of these views. Is there any way to do it?
Thank you in advance.

If you're subclassing UICollectionViewCell, you can resize them in layoutSubviews. If you're building the cell in your controller, you can assign the subviews a tag, and get them later using viewWithTag:.

Related

Add custom view in UICollectionView

I tried lot but not find any way to add custom view in UICollectionView before starting on each UICollectionViewCell. I have attached screenshot, what i want.
I have used UICollectionView to display object section vise and indicate arrow which view custom view i want to add.
Help appreciate..
Thanks in Advance.
.
You will have to write your own UICollectionViewLayout and give it a decoration view (or possibly, if this view is tied to the layout of the section data, some new kind of supplementary view).

Repeat a view in Cocoa application

I have the following design:
How should I proceed? Add a NSScrollView with the first element, which contains a couple of NSTextFields and an NSImage and then repeat in the code? What type of repeater should I use? And... is NSScrollView able to handle this type of design?
Is it possible to use NSTableView?
Thank you!
I would probably have a custom NSView class that contains the date labels on the left, a NSImage that toggles between two states (selected or not) and the request label on the right. You can lay it out either in code or in a .nib and instantiate it that way respectively.
When you create the superview create four of the new subclasses and put them in the appropriate places.
Only use scroll view if you think that you'll have so many options that you will need to scroll.

Have Multiple UIImageView's From 1 UIImageViews

I have declared 1 UIImageView in my code. Is there a way to get multiple out of it? Say for example I have an imageView called red and position that on the screen. Is there a way to have multiple of red on the screen at the one time?
Thanks in advance
One image view is one image view.
If you want more than one, declare more than one.
If you have many similar image views, consider creating one array of many image views instead of a separate property for each one.
If you have all of the image views in a storyboard or .xib file, you can use an outlet collection instead of an outlet to store them.

Proper way to build custom UITableViewCell

I've been wondering about UITableView's and their cells for a while. UITableView is a very handy UIView subclass, but there is a lot of predetermined/forced content on a UITableViewCell. I was wondering what is the best way to create a custom UIView (which will end up being a UITableViewCell) for UITableView?
The cell has a certain style that has to be set and there are predetermined UILabels and accessory views that are completely immutable, other than their contents. I find this to be a big waste, but just giving the cell a custom content view (and background view, if one pleases) doesn't prevent or remove these processes or restore the memory.
Is there any way to create a lighter version of a UITableViewCell subclass? Or is there a way to use a UIView with a selection method instead (other than essentially creating a custom UITableView using UIScrollView)?
Any suggestions would be really appreciated.
There are a few methods:
From a XIB file:
ios steps to create custom UITableViewCell with xib file
http://www.icodeblog.com/2009/05/24/custom-uitableviewcell-using-interface-builder/
Using Drawing:
http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
http://developer.apple.com/library/ios/#samplecode/TableViewSuite/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007318 (4th and 5th examples)
There doesn't seem to be an answer for this. UITableViewCells will always have UILabels and other views automatically added to them. I'm not sure if they are allocated before you set them, though. They may have custom setting / allocation methods.

load uiscrollview same as uitableview

I need to make a cell having a larger length with no of sub views and i am having a no of these cells.i added all of these cells in UIScrollview,When I scroll scrollview I want that it load just like as UITableView Loaded. Please Suggest Some Method With Code.
Thanks In Advance.
You need not to use UIScrollView. I prefer having custom UITableViewCell which would be reused.