UA-17470720-3

Jump to content


Photo
- - - - -

Using built in UIToolbar with SensibleTableView

view-controllers

  • Please log in to reply
6 replies to this topic

#1 nemrok

nemrok

    Jr. Member

  • STV 3.0 Std
  • PipPip
  • 10 posts
Reputation: 2
Good

Posted 30 March 2013 - 12:49 AM

Hi all,

I have a SCTableViewController which contains a UITableView (contained in a UIView) and on the bottom I'm using the built-in UIToolbar from the UINavigationController. I turn on the UIToolbar here:


self.actions.willAppear = ^(SCViewController *viewController) {
self.navigationController.toolbarHidden = NO;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(processShakeDetected:)
name:@"NOTIFICATION_SHAKE"
object:nil];
};

I turn it off here:


self.actions.willDisappear = ^(SCViewController *viewController) {
self.navigationController.toolbarHidden = YES;
[[NSNotificationCenter defaultCenter] removeObserver:self];
};

The problem I'm having is that the UIToolBar is covering the items at the bottom of the UITableView, where the next to last items are inaccessible. I've tried everything I can think of to resize the UITableView height (based on the UIToolbar height) to no avail. It seems that using SCTableViewController with a UITableView + the built in UIToolbar doesn't work as expected. What do I have to do to configure/resize the UITableView so all of the items are accessible when the built in UIToolbar is being used?

Note: in my storyboard, I resized the UITableView to a height of 504 to account for the built in UIToolbar. However this isn't honored since the UITableView still takes the full height regardless - thus causing the issue.

Thanks!
Mark

#2 Dave Guerin

Dave Guerin

    Forum Master

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

Posted 30 March 2013 - 08:46 AM

Hi nemrok,

I'm using a SCTableViewController inside a UINavigationController and I'm also using the UINavigationController's UIToolbar, setting it visible in the same way as you are, and it's not causing any problems.

I'm not using a storyboard however. The only XIBs I'm using are for SCCustomCells. Does that mean it's something in the storyboard that is causing your issues?
Cheers,

Dave

www.dgapps.ie

#3 nemrok

nemrok

    Jr. Member

  • STV 3.0 Std
  • PipPip
  • 10 posts
Reputation: 2
Good

Posted 30 March 2013 - 12:08 PM

Hi Dave,

Thanks for the response. The only difference besides storyboards, is that I'm using an SCViewController. Could you post how you've setup your app, if you don't mind? In particular, how you setup the views.

Thanks,
Mark

#4 Dave Guerin

Dave Guerin

    Forum Master

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

Posted 31 March 2013 - 03:19 AM

Hi nemrok,

Attached, hopefully, you should find a Core Data app that I put together to show a problem with sorting of detail views:

http://sensiblecocoa...-a-detail-view/



I've added toolbar bars to the project, in the same way as I'm adding toolbars to my main project.

Because of this bug:

http://sensiblecocoa...-go-off-screen/

it's difficult to add enough items to a table to get them to extend below the toolbar, so on the first toolbar I've added a button that will populate a set list with lots of songs, more than a screen full. I'm able to scroll that table such that the bottom song cell sits above the toolbar, so the toolbar is functioning as expected.

HTH

Attached Files


  • aaronium112 likes this
Cheers,

Dave

www.dgapps.ie

#5 nemrok

nemrok

    Jr. Member

  • STV 3.0 Std
  • PipPip
  • 10 posts
Reputation: 2
Good

Posted 31 March 2013 - 06:35 AM

Hi Dave,

Cool, I'll take a look at this. Thanks for posting a sample.

Thanks!
Mark

#6 nemrok

nemrok

    Jr. Member

  • STV 3.0 Std
  • PipPip
  • 10 posts
Reputation: 2
Good

Posted 06 April 2013 - 02:13 PM

Hi Dave,

I got this to work by just switching my view controller from SCViewContoller to SCTableViewController :)

Thanks!
Mark

#7 aaronium112

aaronium112

    Jr. Member

  • STV 3.0 Std
  • PipPip
  • 21 posts
Reputation: 7
Good

Posted 10 August 2014 - 09:27 AM

Thanks for sharing that project it helped me out. =)







Also tagged with one or more of these keywords: view-controllers

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users