UA-17470720-3

Jump to content


Photo
- - - - -

Dynamic row heights not working on SCArrayOfStringsSection


  • Please log in to reply
4 replies to this topic

#1 Brendan Duddridge

Brendan Duddridge

    Advanced Member

  • STV 5.0 Pro
  • PipPipPipPipPip
  • 170 posts
Reputation: 7
Good

Posted 17 February 2017 - 04:32 PM

Hey Tarek,

 

So I've got a simple SCTableViewController that displays a list of items. In the table I display an image, some text, and the detail disclosure indicator.

 

I've attached a screenshot of the problem I'm having.

 

Do you know how I can get dynamic row heights? I've read through the forum and in the source and it should be automatic. Unfortunately it's not working for me.

 

Here's my code so you can see if I'm doing anything wrong:

 

	SCClassDefinition *searchDef = [[SCClassDefinition alloc] initWithClass:[TFSearch class] propertyNamesString:@"name"];
	
	SCArrayOfStringsSection *section = [[SCArrayOfStringsSection alloc]
										initWithHeaderTitle:nil
										items:self.form.formSearches
										itemsDefinition:searchDef];
	
	section.allowAddingItems = !isFormEditingLocked;
	section.allowDeletingItems = !isFormEditingLocked;
	section.allowEditDetailView = NO;
	section.allowMovingItems = NO;
	section.allowRowSelection = NO;
	section.addButtonItem = self.addButton;

	section.cellActions.willConfigure = ^(SCTableViewCell *cell, NSIndexPath *indexPath) {
		cell.imageView.image = [UIImage imageNamed:@"smart-folder-blue"];
		cell.textLabel.numberOfLines = 0;
		cell.textLabel.lineBreakMode = NSLineBreakByWordWrapping;
	};
	
	section.cellActions.willDisplay = ^(SCTableViewCell *cell, NSIndexPath *indexPath) {
		cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
		cell.backgroundColor = [UIColor whiteColor];
	};

 

 

Any ideas? I thought that dynamic row heights was just automatic.

 

 



#2 Brendan Duddridge

Brendan Duddridge

    Advanced Member

  • STV 5.0 Pro
  • PipPipPipPipPip
  • 170 posts
Reputation: 7
Good

Posted 17 February 2017 - 04:34 PM

The attachment didn't seem to get added.

Attached Files



#3 Brendan Duddridge

Brendan Duddridge

    Advanced Member

  • STV 5.0 Pro
  • PipPipPipPipPip
  • 170 posts
Reputation: 7
Good

Posted 17 February 2017 - 04:35 PM

One more thing, I am using STV 5.4.0



#4 Brendan Duddridge

Brendan Duddridge

    Advanced Member

  • STV 5.0 Pro
  • PipPipPipPipPip
  • 170 posts
Reputation: 7
Good

Posted 21 February 2017 - 09:46 AM

Any idea why dynamic row heights aren't working? Im using iOS 10.2.1



#5 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 07 March 2017 - 09:02 AM

Hi Brendan,

 

I had a SCSelectionCell with the delimiter set to \n that I couldn't get to auto-resize as the selected items changed. 

 

In the end I used my own XIB for the cell, with autolayout, and it all worked OK.


Cheers,

Dave

www.dgapps.ie




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users