UITableViewCell Grouped Frame extends beyond cell - iphone

I'm creating a custom cell setup. My issue is when I add a subview to the cell and make it align to the right of the cell it goes beyond the right edge of the cell. Apparently the frame goes beyond the visible edge of the cell and onto the background.
I need the right edge to be the inside of the cell. What should I do?

I had to do it manually and just detect if the device was an ipad and change the frame.

Related

fitting a button inside a grouped table cell

I am trying to fit a button to the bounds of a grouped table cell. As you may know, grouped table views have margins along the left and the right of the cells. However, the bounds of the cell are as if those margins did not exist. I COULD hard code the frame but I was curious as to if there was a better way to fit a button inside the cell bounds of a grouped table.
here is my current set up... I also read in another post here to try the autoresizing mask, but that didnt work either.
SubmitButton *search = tableValues.key; //pulling my button object from an array
search.frame = cell.bounds;
cell.clipsToBounds=YES;
[cell addSubview:search];
with this, the edges of the button still stretch beyond the margins of the cell.
Thanks
Subviews should be added to a cell's contentView, not directly to the cell. The cell's frame is the full width of the table view, even with grouped tables. The cell's contentView is sized properly to take into account plain vs. grouped as well as various cell decorations like delete icon, reorder handles, and disclosure indicators.
Adjust the button's frame to the contentView and add the button to the contentView.

How can I resize a UITableViewCell and center it onscreen smoothly?

I would like to grow a selected cell to almost fill the screen.
I am familiar with changing the height of the cell using beginUpdates and endUpdates, but the result is a cell the correct size which is partly offscreen.
I can scroll so the cell is centred onscreen, with setContentOffset: or scrollToRowAtIndexPath:, but this is a separate animation from the height change, which doesn't look good.
Is there a way to combine the two and smoothly grow a cell so it is centred and bigger?

BackgroundView does not adapt round corner in Grouped UITableView

I am learning how to use storyboard and i am trying to build a UITableViewCell with grouped style. I tried to put a png file and set it as background for the cell.
My png file is a rectangular image.
When i open it in simulator, I found the first cell corner become a rectangle rather than a round corner cell.
What should i can in order to make the first and last cell to be corner rounded?
This is a know problem when using Grouped TableView.
You can either use the backgroundColor of UITableViewCell or you will have to draw the background by hand and check wether is the first of last in the section and add the rounded corners.
have a look at this post
Try to set the property clippingSubviews of your cells to YES.

iPhone - UITableviewcell label movement when press Editing

In the normal behavior when Edit is pressed, the red delete circles appear from the left. This shifts the entire cell to the left.
When this happens, custom labels on the far right of the cell overlap the cell movement touch area.
The solution is to move custom UILabels to the left when edit is pressed.
How is this done?
Assuming your UILabel is being added to the contentView of your cell, just make sure your subviews (whether a UILabel or other UIView-derived object) have their autoresizingMask set up to allow flexible width (UIViewAutoresizingFlexibleWidth). Also, your left subviews need UIViewAutoresizingFlexibleRightMargin, while your right subviews should have UIViewAutoresizingFlexibleLeftMargin.

Covering space from one UITableView's cell with another one

The design of the UITableView is something like this:
I want to make my cells with a tiny triangle, like in a comic book. The thing is, how can i add the triangle to the size of my custom cell? The common rectangle size wouldn't work if i want the user to be able to tap that little rectangle.
And how can i make the opposite? I want the triangle to cover the space of another cell, so tapping the little triangle of the first cell, covering part of the second cell's rectangle space, would activate de first one. This is, substracting a little triangle from the cell's space.
Not sure it would work, but building on user697562's comment, you could try the following:
Add a small UIView to the table cell to represent the small triangle
Rotate it using its transform property, making sure that, along with its frame, it will have the proper placement.
Add a UITapGestureRecognizer to the UIView
Add an instance variable to the view to save the indexPath of the cell it's in (or even the above cell, since it will be associated with the above cell). This way when the gesture recognizer is triggered, you know what row you're in.
Write the action method associated with the gesture recognizer to do the same thing as tableView:didSelectRowAtIndexPath: would do for the above cell.
Set the separatorStyle property of the UITableView to UISeparatorStyleNone, so that it won't draw the lines between cells. If this doesn't work just set the separatorColor property to your table cell's background color.
Draw a border along the top & bottom of the cell, accounting for the triangle.
Good luck with it! Let me know whether it works if you try it.