UA-17470720-3

Jump to content


Photo
- - - - -

Customizable UITextView cell behavior


  • Please log in to reply
5 replies to this topic

#1 Karl

Karl

    Jr. Member

  • STV 2.0
  • PipPip
  • 13 posts
Reputation: 0
Neutral

Posted 30 September 2010 - 04:55 AM

Hello again,

I would like an option to have a UITextView type cell open a detail view with one large UITextView. Something like the comment entry screen in the facebook app.

Is this possible to do using the willConfigureCell delegate method?

Thanks!

#2 Karl

Karl

    Jr. Member

  • STV 2.0
  • PipPip
  • 13 posts
Reputation: 0
Neutral

Posted 30 September 2010 - 05:57 AM

Actually I think it is better to put the textview cell in its own section, so you can disregard my previous post.

One problem with this, the top and bottom left corners of the text view overlap the cell border when the table has a grouped style.

Thanks again!

#3 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 30 September 2010 - 03:00 PM

Would you please post the code you used to create this? Thanks!

#4 Karl

Karl

    Jr. Member

  • STV 2.0
  • PipPip
  • 13 posts
Reputation: 0
Neutral

Posted 30 September 2010 - 08:19 PM

I am using iOS 4.1.

The root view controller is a UITableView with style set to Grouped in IB.


- (void)viewDidLoad {
	[super viewDidLoad];

	self.title = @"testing";
	
	model = [[SCTableViewModel alloc] initWithTableView:self.tableView withViewController:self];
	object = [[testobject alloc] init];
	
	SCClassDefinition *def = [SCClassDefinition definitionWithClass:[testobject class] 
												 withPropertyNames:[NSArray arrayWithObject:@"longField"]
												 withPropertyTitles:[NSArray arrayWithObject:@""]];
	
	[def propertyDefinitionWithName:@"longField"].type = SCPropertyTypeTextView;
	
	SCObjectSection *section = [SCObjectSection sectionWithHeaderTitle:@"Enter some long text in this field:" withBoundObject:object withClassDefinition:def]; 
	[model addSection:section];
}


#5 Patrick Scheips

Patrick Scheips

    Sr. Member

  • STV 3.0 Std
  • PipPipPip
  • 49 posts
Reputation: 3
Good

Posted 15 October 2010 - 04:41 AM

kamanova wrote:

One problem with this, the top and bottom left corners of the text view overlap the cell border when the table has a grouped style.


To (temporary) fix this, I'v done a little hack.
I put this into -(void)layoutTextView in SCTableViewCell.m:

self.textView.backgroundColor = [UIColor clearColor];

This removes the (white) background color of the text view so that the cell borders shine through.
But note that I don't how this affects plain style table views.

#6 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 15 October 2010 - 05:07 AM

Thanks Patrick. We're still working on solving this and we'll update you guys ASAP.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users