UA-17470720-3

Jump to content


Photo
- - - - -

Cell resizes but then fixes


  • Please log in to reply
55 replies to this topic

#1 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 17 September 2015 - 02:16 AM

Hello,

I have detail view with three SCObjectSections. Each section has a single custom cell.

The second cell (row 1) contains only a label. The cell is supposed to resize to fit the contents of the label.

When I load the first detail record, the cel (row 1)l resizes to fit that content, however, when I load subsequent detail record, the cell (row 1)  remains at the first size used.

Other cells on the detail record behave as  they should.

 

What should i do to resize the cell every time a new detail record is loaded?

 

thanks

karl


Edited by Karl1348790294, 17 September 2015 - 02:17 AM.


#2 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 17 September 2015 - 07:28 AM

I wonder if this is related to my previous problem where WillConfigure only fires once for each cell, no matter how many separate items are selected from the master.

(The master is in the left hand side of a split view)

When I first select an item from the master list, the detail is loaded and configured.

When I select subsequent records from the master, the detail view is amended, not reloaded (even though  the segue is set to Replace).

So it seems the cell never gets reconfigured with the new information.

 

The detail view had three custom cells.

The flow of control is as follow:

 

When the app starts:

 

Loads Detail View

 

When I first select a record from the master list, the detail view does:

 

Will Configure

Will Display

 

Will Configure

Will Display

 

Will Configure

Will Display

 

When I select any subsequent records from the master list, the detail just does:

 

Will Display

 

Will Display

 

Will Display

 

Presumably this is why the cell is never resized.

What can i do about it?

 

thanks

karl

 


Edited by Karl1348790294, 17 September 2015 - 07:35 AM.


#3 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 17 September 2015 - 09:06 AM

Hi Karl,

 

How can we replicate this behavior? Can you kindly reproduce in any of our samples then attach it here? Thanks!



#4 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 17 September 2015 - 10:11 AM

yes, thank you,

I have attached the project that shows this behaviour. 

I have added trace lines to show what seems to be happening.


Another problem i have been having with this project is that i have set up a custom detail view.

This works fine until i try to embed the detail view in navigation controller.

After that all my customisations are ignored. 

 

thanks

karl

 

Attached Files



#5 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 22 September 2015 - 06:34 AM

Any ideas on this one?

karl



#6 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 22 September 2015 - 02:17 PM

Hi Karl,

 

Thanks for attaching your project. I've taken a look at your custom cell, and it seems that you don't have a clear line of constraints going from the top to the bottom of the cell's contentView. In other words, you have to make sure that the Autolayout Engine can determine the cell height using the Autolayout constraints you've provided. You can find a video tutorial on how to do that here: 

.

 

It might help if you start simple at first and see if everything is working fine, then start adding the other controls.

 

Hope this helps.



#7 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 23 September 2015 - 03:14 AM

Thank you, I have looked at that video but i don't think that is the problem here.

The cells always display and adapt correctly the first time, and it is only on subsequent displays that they do not.

Also, I am sure that the layout constraints won't prevent "willConfigure" from being called.

 

I suspect this is part of a bigger problem that I am having in STV when working with UISplitVIews.

I have experimented with this a lot and found out that:

 

1) STV works fine with the very simple templates that are installed with it, and

2) STV works fins when both master and detail are being displayed in the left page of the spilt view, everything laid out ok, but

3) when I put the master list in the left pane, and the detail display in the right pane, with a navigation controller, then I have to tell STV where the detail view is, in which case none of the custom formatting (layout) is observed.

4) when I try and put both master list and detail in the right have pane of the split view i cannot get it to work at all.

 

I have experimented a lot with STV is splitviews, and find it difficult to make it work in all but the very simplest hierarchies.

 

I'd value your insights, perhaps there is something fundamental that i am doing wrong.

 

All this being said, I am loving using STV which is  brilliant tool, its a great help for my Parse.com application.

 

Thanks karl


Edited by Karl1348790294, 23 September 2015 - 06:19 AM.


#8 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 23 September 2015 - 01:07 PM

Thank you very much Karl.

 

I initially wasn't able to run your app to check that myself since there were a lot of linker errors, but I've given it another look and it seems that you're not including 'libsqlite3.dylib' in the project's files (I am wondering how it compiles at your side?). I'll now be able to have a closer look on this and get back to you.



#9 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 23 September 2015 - 01:34 PM

So I am finally able to run the app. I've attached a video of what I am getting, as I am not able to find anything wrong with the cell resizing. What am I missing here? 

 

https://www.dropbox....v/Karl.mov?dl=0



#10 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 24 September 2015 - 11:45 AM

hi Tarek, thanks for replying

 

The "Course description" cell.

 

 

If you select the "Galatians" study first, the cell is three lines high. Then selecting the "Mark" study does not resize it.

If you select the "Mark: study first, the cell is one line high. The selecting the "Galatians" study does not resize it.

 

I was supposing that the cell would resize to fit the current contents, rather than retain the size of the first item selected.

 

thanks

karl



#11 Dave Guerin

Dave Guerin

    Forum Master

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

Posted 25 September 2015 - 03:06 AM

Hi Karl,

 

I was able to build your TEST01 project after  bit of fiddling around.

 

I can see what you're talking about. The "Course description" text sticks at three or four lines if you select Galatiians first after a build, and sticks at one line if you select Mark first after a build.

 

if you set the background colours of the label and the cell contentView to something contrasting, red and yellow maybe, it looks like it's actually the UILabel that is not resizing:

 

Attached File  screenshot.png   133.86K   9 downloads

 

I've tried various combinations of Autolayout constraints but nothing seemed to work to get the UILabel to resize to its new content.

 

I'm not sure if it's a STV thing or not, and I don't know enough Swift to debug further.


  • Tarek likes this
Cheers,

Dave

www.dgapps.ie

#12 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 25 September 2015 - 03:14 AM

Hi Dave,

 

Thanks for taking the time to look at this. I suspect its because "WillConfigure" i not being called - other than for the very first record. But, I will have to wait and see what Tarek says.

 

Not sure why there are problems getting the project to compile. I removed all the frameworks, because i thought that was how people generally posted projects to save space. Still so much to learn.

 

Thans again

karl



#13 Dave Guerin

Dave Guerin

    Forum Master

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

Posted 25 September 2015 - 03:50 AM

Hi Karl,

 

You should defiantly remove the two STV frameworks. The STV License doesn't allow you to share them at all.

 

The Parse and Bolts frameworks you could have probably left in as they are publicly available.

 

And for some reason your project, as Tarek said, was missing 'libsqlite3.dylib'. Not sure why that was.

 

willConfigure is being called, just once, and yes I think it should be called every time you select a new master cell. It looks like one instance of CourseDetailTableViewController is being reused where as I thought a new one would be used each time.  As you say maybe Tarek can shed some light.


  • Tarek likes this
Cheers,

Dave

www.dgapps.ie

#14 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 25 September 2015 - 03:58 AM

Thank you.

 

Yes, i think the detail is being reused. I suspect this relates to the other split view problems that i mention earlier in the post.

I will wait and see.

thanks

karl



#15 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 25 September 2015 - 08:36 AM

Thank you guys. I am looking into this.



#16 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 02 October 2015 - 01:11 AM

is this still on-going?



#17 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 02 October 2015 - 08:37 AM

Hi Karl,

 

Yes, we're planning a release by the end of next week that will have fixes to this and several other issues. Thanks a lot for your patience.


  • Dave Guerin likes this

#18 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 02 October 2015 - 08:45 AM

That's great thanks!

karl



#19 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 06 October 2015 - 12:11 PM

Hi Karl,

 

We just tried testing our latest STV code with your app, but it seems that no data is available anymore. Are we missing something? Thanks!



#20 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 07 October 2015 - 07:06 AM

oops, Sorry, i have made some changes to the Parse database (renamed all the fields!) I didn't think you would use this project again.

Sorry to cause a problem. I can send an updated app if you want (it would be tomorrow though)

thanks

karl






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users