Expanding a UITableViewCell with CoreAnimation - iphone

I'm trying to expand a UITableViewCell to fill the entire screen using CoreAnimation.
How can I animate a TableViewCell so that it looks like the cell is expanding to fill the entire screen?
I will then push another ViewController in the completion block of the animation (without the user noticing).

I don't think it's possible to take the actual cell and expand it to fill the screen, because the TableView is managing the cell and could respond rather poorly to the cell's size going crazy all of a sudden.
What I would do is make a 'copy' of the cell using your own class extending UIView, display the copy directly above the cell of the table view (let me know if you need details on that step or if you can figure it out yourself), and then animate that to fill the screen.
For tips using CoreAnimation and layers, go try google - there's a lot out there already on the subject.

Related

make view controller scrollable with collection view

I need to create a view controller like this or like user instagram's profile
not exactly same, I just want to add label and buttons and collection view,
but I want all of this in scroll viewController
I think I can't do that from storyboard, so how I can make a view controller scrollable programmatically?
and then I want to add the label and buttons inside the scroll , I can do that programmatically , but how I can add collection programmatically inside it?
One of the possible solutions is to make the whole container a "UICollectionView" -or "UITableView", depends on what exactly you want to build-, and then, create a custom cell for each area depending on what do you want to display in it.
It might sounds a little bit strange in the beginning, but you will notice that it is a great technique to handle scrolling in your scene, including some of extra nice features, such as:
auto scroll content resizing for "UIKeyboardWillShowNotification" and "UIKeyboardWillHideNotification" events.
the ease of showing and hiding sections from the UI (actually they are cells!).
UPDATED: For example:
You can make the first part (red rectangle) as a UICollectionReusableView and customize it by adding your images and button in it, second part (blue square) as a UICollectionViewCell and so on...
This is the general idea of what how you can do it.

Custom cell in UITableView

I am making a custom cell which has text fields and as a result the custom cell is greater than the size of the iphone screen.But i am not being able to do horizontal scroll to reach the end of the cell.
I have tried using viewController and adding table view to it as well as creating table view controller and adding custom cell to it.
when doing it through TableViewController,I am not able to horizontally scroll it,whereas i am not getting how to add Custom cell class to the tableView object placed in viewController.I know that UITableView is a subclass of UIScrollView but not able to implement it.Please help.
Thanks
as per the documentation at
A table view in the UIKit framework is limited to a single column
because it is designed for a device with a small screen. UITableView
is a subclass of UIScrollView, which allows users to scroll through
the table, although UITableView allows vertical scrolling only.
so as desired in your case you will have to take some other approach. Now using Custom cell with TextFields should not actually need you to require Horizonatl scrolling. If the text is really large you would like to consider using TextView instead of TextFields.
Hope it helps
Ideally, you should be truncating your text. But if it is important for you to display the entire text, add a scroll view as a subview (or set it as the content view) and add your labels to the subview. Each cell will then be individually horizontally scrollable.

iPhone: some UITableView's cells appears blank in edit

I use tableView with custom cells and for cell drawing I use drawRect: method for scrolling performance. In edit mode when I move cells move and down sometimes some cells appear blank. And during scrolling also random cells start appear blank.Please look attached images. Can someone help to understand problem?
if you are using dequeueReusableCellForIdentifier then try removing that.
I mean to say alloc a new cell every time.
I am suggesting above based on assumption that your cell contains some heavy data which takes time in drawing. In this case if you reuse cell then it will take cell that goes out of visible screen and will paint draw new data in it.
If this doesn't help then please post some code showing how you are creating custom cell.

Best way to avoid memory leaks for Multiple Buttons in UITableViewCell

I've got an array of buttons in a UITableViewCell.
I populated them all through the cellForRowAtIndexPath method, but my tableview gets sluggish even though I have released everything.
Should I be using a custom UITableViewCell to populate?
Any suggestions on how to make this as smooth as possible for the user would be great.
Screenshot below.
You could create a custom cell / custom view pair for this specific cell, where you can draw all yours buttons in drawRect:. However, this would essentially draw all your buttons as an image so you wouldn't be able to tap them, but I guess you can always create a UITapGestureRecognizer to your cell (you'd still have to figure out which button was pressed by examining x,y values).
Still, I don't see any point in adding your tag buttons inside a UITableViewCell. You could come up for an alternate design in your UI, i.e. a UIView presented on top of the table, or a modal controller maybe.

Why is my UITableView getting its images messed up?

I'm trying to get my UITableView to show cells with images placed on them (contained in a UIImageView overlaid). I'm wondering why when scrolling up and down, the images look like they're overlaid on top of one another.
What can I do in this case for the sake of memory management as well as to fix this issue?
Make sure that when you're dequeuing a reusable cell that you remove whatever image view was in the cell before you add the one for the current index path.
Alternatively, you can change the image property of the UIImageView.