Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mikezang

macrumors 6502a
Original poster
May 22, 2010
930
38
Tokyo, Japan
I made a table view in nib file and set style to grouped, then I put a TableViewCell into table view, but when I run it, I found it is no round corner in grouped table view?

How can I show round corner?
 

Attachments

  • SnapShot 2010-10-01 at 23.38.48.jpg
    SnapShot 2010-10-01 at 23.38.48.jpg
    73.4 KB · Views: 1,002
  • SnapShot 2010-10-01 at 23.39.19.jpg
    SnapShot 2010-10-01 at 23.39.19.jpg
    126.3 KB · Views: 631
Here is my table view cell attributes.
 

Attachments

  • SnapShot 2010-10-02 at 0.23.46.jpg
    SnapShot 2010-10-02 at 0.23.46.jpg
    71.9 KB · Views: 375
  • SnapShot 2010-10-02 at 0.23.10.jpg
    SnapShot 2010-10-02 at 0.23.10.jpg
    70.9 KB · Views: 347
  • SnapShot 2010-10-02 at 0.22.52.jpg
    SnapShot 2010-10-02 at 0.22.52.jpg
    43.9 KB · Views: 334
I am not sure what I have to do, can you tell me?
Think about how the layers (subviews) that make up the cell are drawn. Think about how the background colors affect that layering. It may take some creativity and pondering before you come up with the reason.
 
Think about how the layers (subviews) that make up the cell are drawn. Think about how the background colors affect that layering. It may take some creativity and pondering before you come up with the reason.
I don"t know. But I know if I make a grouped table view in programming, I can get round corner, so I thought if I set style to grouped in nib file, it should show as the same in programming without special settings.

I also set background color to white, but I got the same result.

If you don"t want to tell me result, that is ok!

I just use it at the moment, I will do it in programming when I really need it...
 

Attachments

  • SnapShot 2010-10-02 at 1.07.50.jpg
    SnapShot 2010-10-02 at 1.07.50.jpg
    72 KB · Views: 256
But I know if I make a grouped table view in programming, I can get round corner, so I thought if I set style to grouped in nib file, it should show as the same in programming without special settings.
If you look closely at the tops of your table sections you will actually see that there is rounded corners. But there is something in your settings that is causing the table sections themselves to render different as well as the cells at the bottom of the sections.

I also set background color to white, but I got the same result.
Getting warmer...

If you don"t want to tell me result, that is ok!
I'm trying to encourage you to think independently rather than posting a new thread as soon as you encounter a new issue.

I just use it at the moment, I will do it in programming when I really need it...
If you did in code the same thing you're doing in IB, you will get the same problem. It's not just the use of IB that is the issue.
 
Thanks for your reply.

You know when I found problems, I think about it by myself, then I will google Internet if I couldn"t get any correct result. After that if I still have no answer, I post thread here. I spent several hours for this issue before I post

Like you said, it is best and easy to remember if people can get result by one"s self, but if he had no skills or experience, he has no way to get right result, in this case, a detail tip or hint will let him to get answer.
 
Well, I got what I need in programming as below.
 

Attachments

  • SnapShot 2010-10-02 at 1.56.04.jpg
    SnapShot 2010-10-02 at 1.56.04.jpg
    87.8 KB · Views: 320
You know when I found problems, I think about it by myself, then I will google Internet if I couldn"t get any correct result. After that if I still have no answer, I post thread here. I spent several hours for this issue before I post
Well, it's hard for us to guess what you've already tried. So, rather than having us guess, I'd suggest you just tell us. This is quite helpful when your intent is getting answers.

...in this case, a detail tip or hint will let him to get answer.
Which, I feel, I've already provided.

But let me try again.

There are two things you can try:
  1. Figure out how the background colors of your subviews are affecting the rendering of your cells.
  2. Adjust the layout of your subviews so that they don't overlap the corners.
 
There are two things you can try:
  1. Figure out how the background colors of your subviews are affecting the rendering of your cells.
  2. Adjust the layout of your subviews so that they don't overlap the corners.
I think later is what I met, but I am not sure how to change the size of my custom cell in IB, though I tried more and more.
But in programming, it is very simple, I don't need to care about size and I got what I need, though I still hope I can do the same in IB.
 
But in programming, it is very simple, I don't need to care about size and I got what I need, though I still hope I can do the same in IB.
What did you do in the programming? Can I see the code? That might help me to explain how you can achieve the same thing via IB.
 
What did you do in the programming? Can I see the code? That might help me to explain how you can achieve the same thing via IB.
Code as below
Code:
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:BrokerCellIdentifier] autorelease];
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 150, 25)];
    UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(200, 12, 200, 25)];
}
 
All you're doing is setting the UI elements' frames. This is easily done in IB using the Size Inspector, as seen below:
 

Attachments

  • Screen shot 2010-10-01 at 12.40.49 PM.png
    Screen shot 2010-10-01 at 12.40.49 PM.png
    20.1 KB · Views: 1,767
All you're doing is setting the UI elements' frames. This is easily done in IB using the Size Inspector, as seen below:
That is done in IB, but the result is not the same as in programming, this is why I asked here.
 
That is done in IB, but the result is not the same as in programming, this is why I asked here.
Then your code must be doing something else you're not showing. Because the code you showed and the IB settings I showed do do the same thing.

P.S. What is the difference you see?
 
Then your code must be doing something else you're not showing. Because the code you showed and the IB settings I showed do do the same thing.

P.S. What is the difference you see?
What do you mean?

The difference is with or without round corner.
I think the different is as below, this due to different result:
IB is to subclass UITableViewCell, and programming is to add Label/TextField to UITableViewCell.
 
Hi
Now I got what I need in IB, like you said that is cell"s contentView background, I set it to clear color.
 

Attachments

  • SnapShot 2010-10-02 at 20.43.55.jpg
    SnapShot 2010-10-02 at 20.43.55.jpg
    44.4 KB · Views: 278
  • SnapShot 2010-10-02 at 20.46.47.jpg
    SnapShot 2010-10-02 at 20.46.47.jpg
    88.2 KB · Views: 316
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.