UA-17470720-3

Jump to content


Photo
- - - - -

Large gap between table cells and footer text


  • Please log in to reply
11 replies to this topic

#1 notreallyme

notreallyme

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 82 posts
Reputation: 8
Good

Posted 03 March 2014 - 04:11 AM

I added footer text to automatic generated cells and observed, that the longer the footer text is, the greater the gap between the last cell end the first line of the footer is. Having a footer with about 15 lines rendered, the gap is more than half of the screen size which makes the tableview look quite odd and broken, and the user would have to scroll down to read the text. I also noticed this behavior with manually added footers to STV-Tables in my code. Every footer added to my own (old) tableviews look great, no gap no matter how long the footer text is. How can i make the footer text start directly below the cells for automatic generated cells, no matter how long the footer text is?

 

    [SCEntityDefinition definitionWithEntityName:@"AlarmDefinition"
                            managedObjectContext:context
                             propertyNamesString:@":(changedAttribute,limit,numbers,repeat,usageOrBudget):Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ... Very long text ... ... ... ..."];

Using footerHeight is no solution here, as this has to be calculated new depending of the device type used and whether the user holds the device portrait or landscape. The biggest problem of setting footer height manually here is that i have the section not in my hands, as it is generated automatically on the fly by STV because the tableview in question is displayed by STV from an ArrayOfObjectsSection when the user taps on "+" or an already existing object. 


Edited by notreallyme, 03 March 2014 - 04:24 AM.


#2 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 03 March 2014 - 08:03 PM

are we talking here your other app running under iOS6 or iOS7?

I too have seen the footer not working well, but i don't think it has to do with STV, as STV is not generating some special footer or anything, STV is built from UITable Objects, as just sits on top

 

you can see the same problems with footers in iOS7 in the devices Settings.. pick an app that adds acknowledgements like "stop motion, smartnote, paper" any like that and see what happens when that opens up

If you look at those, you will see that you have to scroll UP to see more, even though the tableview does not think there is anything higher


  • David DelMonte likes this

P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#3 Dave Guerin

Dave Guerin

    Forum Master

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

Posted 03 March 2014 - 11:35 PM

I'd agree with Ozie in that I think it's an iOS7 issue, not STV specific.

 

To get around this sort of thing I do:

 

[self.tableViewModel sectionAtIndex:0].footerView = [self footerWithText:[self.tableViewModel sectionAtIndex:0].footerTitle];
 

 

where my footerWithText: method returns a label of the required number of lines and size using the text set in STV.


  • David DelMonte likes this
Cheers,

Dave

www.dgapps.ie

#4 notreallyme

notreallyme

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 82 posts
Reputation: 8
Good

Posted 04 March 2014 - 11:24 AM

are we talking here your other app running under iOS6 or iOS7?

I too have seen the footer not working well, but i don't think it has to do with STV, as STV is not generating some special footer or anything, STV is built from UITable Objects, as just sits on top

 

you can see the same problems with footers in iOS7 in the devices Settings.. pick an app that adds acknowledgements like "stop motion, smartnote, paper" any like that and see what happens when that opens up

If you look at those, you will see that you have to scroll UP to see more, even though the tableview does not think there is anything higher

I have no problems with footers in my own tableviews that do not use STV. No matter how long the text is, it starts directly below the last cell of the section. The App is set to base sdk iOS 7 now. So the problem is only present in relation with STV and iOS 7 in my app, not with every tableview. Any clues on how to solve this?



#5 notreallyme

notreallyme

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 82 posts
Reputation: 8
Good

Posted 04 March 2014 - 11:27 AM

I'd agree with Ozie in that I think it's an iOS7 issue, not STV specific.

 

To get around this sort of thing I do:

 

[self.tableViewModel sectionAtIndex:0].footerView = [self footerWithText:[self.tableViewModel sectionAtIndex:0].footerTitle];
 

 

where my footerWithText: method returns a label of the required number of lines and size using the text set in STV.

Ok, i can try this at STV tableviews/sections i create directly. But as i describes i need a specific footer text at a tableview that STV generates on the fly with the arrayOfObjects when the user taps on "+" or a cell representing an existing object in the table. How can i set the footer text when this specific table is about to be presented by STV?



#6 notreallyme

notreallyme

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 82 posts
Reputation: 8
Good

Posted 04 March 2014 - 11:35 AM

I'd agree with Ozie in that I think it's an iOS7 issue, not STV specific.

 

To get around this sort of thing I do:

 

[self.tableViewModel sectionAtIndex:0].footerView = [self footerWithText:[self.tableViewModel sectionAtIndex:0].footerTitle];
 

 

where my footerWithText: method returns a label of the required number of lines and size using the text set in STV.

This does not work in an SCTableViewController, method footerWithText is reported as not found by the compiler.



#7 notreallyme

notreallyme

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 82 posts
Reputation: 8
Good

Posted 04 March 2014 - 11:39 AM

are we talking here your other app running under iOS6 or iOS7?

I too have seen the footer not working well, but i don't think it has to do with STV, as STV is not generating some special footer or anything, STV is built from UITable Objects, as just sits on top

 

you can see the same problems with footers in iOS7 in the devices Settings.. pick an app that adds acknowledgements like "stop motion, smartnote, paper" any like that and see what happens when that opens up

If you look at those, you will see that you have to scroll UP to see more, even though the tableview does not think there is anything higher

Following sentence in the STV Book sounds there is some kind of height calculation of STV : Notice that STV automatically calculates the header’s height based on the height of the header view. If you still need to fine tune it or even set the header height yourself, just set the section’s ‘headerHeight’ property to the desired height. The same functionality is available for footers as well.   



#8 Dave Guerin

Dave Guerin

    Forum Master

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

Posted 04 March 2014 - 01:04 PM

footerWithText is my own method, it takes the NSString of the footerTitle and returns it in a UILabel formatted as I require. 

 

Yes, STV will be calculating the height of the footer view, that's how it deals with multi line footers, although they seem to be problematic in iOS7.

 

For your arrayOfObjects one of the sectionActions will give you the detail section, and in that action you can set the footerView for the section.

sectionActions.detailModelWillPresent = ^(SCTableViewSection *section, SCTableViewModel *detailModel, NSIndexPath *indexPath) {

            [detailModel sectionAtIndex:0].footerView = myFooterView;

};

might be the way to do it, if I understand correctly what you're after.


Cheers,

Dave

www.dgapps.ie

#9 notreallyme

notreallyme

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 82 posts
Reputation: 8
Good

Posted 04 March 2014 - 01:55 PM

footerWithText is my own method, it takes the NSString of the footerTitle and returns it in a UILabel formatted as I require. 

 

Yes, STV will be calculating the height of the footer view, that's how it deals with multi line footers, although they seem to be problematic in iOS7.

 

For your arrayOfObjects one of the sectionActions will give you the detail section, and in that action you can set the footerView for the section.

sectionActions.detailModelWillPresent = ^(SCTableViewSection *section, SCTableViewModel *detailModel, NSIndexPath *indexPath) {

            [detailModel sectionAtIndex:0].footerView = myFooterView;

};

might be the way to do it, if I understand correctly what you're after.

Thank you for the suggestion. Ok, that results in one large line without line breaks at the view limits. I want to avoid fiddling around with different windows sizes/orientations but just want to hand this formatting over to iOS, just like i do it in my own tableviews by simply returning my text in titleForFooterInSection.



#10 notreallyme

notreallyme

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 82 posts
Reputation: 8
Good

Posted 04 March 2014 - 02:17 PM

I give up on this topic. STV is of no great help here. My own tableviews look much better regarding the footer text. I can not set the text as long as needed here and have to leave out important information that would help my users to use the settings. Its a pity :-(.


Edited by notreallyme, 04 March 2014 - 02:17 PM.


#11 notreallyme

notreallyme

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 82 posts
Reputation: 8
Good

Posted 15 November 2014 - 10:32 AM

I just wanted to ask if there should be any enhancements in V4.0 of STV regarding this topic? It seems that things got worse now, especially when the users change the text size in the iPhones settings. I got complains from the users of my app (and they are proven with screenshots!), that the footer text is rendered above the table view cells, if the text setting is in the middle or right from the middle (on the iPhone 6). Are you already working on this topic? The parts in my app where is use STV look quite catastrophic now, when i use footer text there.



#12 notreallyme

notreallyme

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 82 posts
Reputation: 8
Good

Posted 15 November 2014 - 10:57 AM

Ok, to give answer to myself: I had to remove all the workaround-code for V3.x that manipulates the footerheight with the new version STV. Maybe others that helped themselve with the workaround described in this thread should look through their code not to be surprised by this (because changing text size of the iPhone is something e.g. i had not in my test program up to now).






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users