Changing grouped tables border radius - iphone

Is it possible to change how radius of the grouped UITableView? The rounded corners are way to drastic for my design.

I believe that the only way to do this is to provide your own background images for your table cells. You can provide 3 images to have a rounded feel to the UITableView like Apple Does.
in
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
set the cell's backgroundView to a UIView with the image you want based on the cell index. This will allow you to set the Top, Middle and Bottom.
This is a pretty good article
http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
just be sure to dequeueReusableCellWithIdentifier:

No, it isn't. You can duplicate it though with a standard tableview and a couple custom background images.

You have to change both cell.backgroundView and cell.selectedBackgroundView with a view of your choice.

Related

UITableView custom plain gray index

I really need to implement a set of gray index bars for my app.
Currently, I'm using a UITableView which I split off into multiple sections.
However, the default section indexes have a gradient appearance which I think is undesirable.
Is it posssible to change the indexes to have a custom appearance such as a plain gray appearance?
If so how? Thank you!
You can implement your custom "index view" ( section header ) by using these tableView delegate or datasource (I'm kind of blur) methods.
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;

Background image does not extend to accessory view background in table view cell

I'm using the code below to set a background under each cell in my table view. It works fine but there's a white space under the accessory view on the right side so the background does not cover this area. Any idea on how to fix this issue ?
(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.contentView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"cell-background.png"]];
}
Thx for helping,
Stephane
You probably want to create a custom cell. Please see Apple's documentation about contentView.
To add subviews to a cell to customize it furthur please see this. It also has a section on how to create custom cells from XIBs.

Custom UITableViewCell dilemma

I got a kind of problem. At this point I have made a custom tableviewcell, nothing fancy just two labels with 1px white shadow beneath the text. The problem is that when the user (me) select a cell the blue highlighting looks really awkward because of the shadow. So I need to disable/remove the shadow on highlighting.
I have not found any methods which are being called once the user selects the row, just after the user removes his finger.
So at this point I need to subclass UITableViewCell just to write two lines of code in the setSelected-method that does it. Are there any better ways to do this? And yes, I just add views to the contentView property of the cell.
And what is the layoutSubviews-method for? I don't find it in documentation but obviously it is in the iOS so...When does it get called and in what context?
Because when I subclass a UITableViewCell, what should I do with the sizes of the view-components?
Thanks in advance!
The below method is called just before the user is about to select the row....
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath

(iphone) aqgridview question. how to make shelf?

I'm using aqgridview to create a book-shelf like UI.
I can place image and title for image fine (with the ImageDemo example provided in aqgridview).
I want to place 'shelf' image where the image title is. (as in http://itunes.apple.com/ca/app/rivet-for-ipad/id375055319?mt=8)
I can set the background color of the label for title but the shelf background image won't be there where there's no cell in the first place.
Hence shelf image doesn't cover the entire screen width.
How can I stretch the shelf image?
Thank you
i'm also using AQGridView for a book grid with shelves, i found the best and fastest way to do this is simply use a UITableView.
Create a UITableView and add the shelves images as rows (Configure UITableViewCell)
Set the AQGridView backgroundView to the UITableView
_gridView.backgroundView = _tableView
you can use
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
to use different shelf graphics for different shelfes
but i'm guessing you already found way by now.

Creating a UITableView with Taller Cells on the iPhone

How can I go about creating a UITableView with taller cells? Basically, I want to create a full screen table with only four cells, but they should take up the entire screen (1/4 each).
Assuming this is possible using a UITableView, can it be done both in code and in Interface Builder? And also, can each cell have its own height?
--Tim
Just use the -tableView:heightForRowAtIndexPath: method from the UITableViewDelegate protocol to customize the height of each cell. Something like this works just fine:
- (CGFloat)tableView:(UITableView *)tv heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 70.0f;
}
Hope that helps.
For best performance, if all your rows are the same height, use the rowHeight property. It's accessible from both code and Interface Builder.
If you want to customise individual row heights, then you need to implement the - tableView:heightForRowAtIndexPath: delegate method. It's a little slower performing, but more flexible.