iphone - How to reliably subclass UITableViewCell for grouped UITableView? -


When writing an optimized subclass of UITableViewCell , I think the result is for rectangular cells Good works do not work at all for a plain style UITableView , but rounded cells in the grouped style table.

Is there a reliable subclass UITableViewCell to attract groups that work for group-style tables? (Without using the interface builder.)

The answer can be as simple as first calling [super

I am creating first

UITextField and add it to contentView initWithStyle: method:

  - (id) initWithStyle: (UITableViewCellStyle) style re- User: (NSString *) reuseIdentifier {self = [super initWithStyle: genre reuseIdentifier: reuseIdentifier]; If (auto) {inputField = [[UITextField alloc] initWithFrame: CGRectZero]; [Self.contentView addSubview: inputField]; InputField.borderStyle = UITextBorderStyleLine; [Inputfild release]; } Healthy return; }  

Then in LayoutSubviews, I have found this:

  - (zero) layout switches {inputField.frame = CGRectMake (5, 5, 100, 20); }  

With that code, the text field is 5px from the left of the screen, which is definitely 5px on the left side of the table cell when it is in group mode In other words, The table view is not outside the cell Nobody is good.

Use this code and input field is placed 5px on the right side of the cell as I want:

  - (zero) Layout Features {[Super Layout Switches]; // Magic Line inputField.frame = CGRectMake (5, 5, 100, 20); }  

I could completely misunderstood the problem you made!

Eric


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -