UA-17470720-3

Jump to content


Photo
- - - - -

Move "Clear Image" Button?


  • Please log in to reply
2 replies to this topic

#1 designwerks

designwerks

    Advanced Member

  • STV 5.0 Std
  • PipPipPipPipPip
  • 139 posts
  • LocationKingsville, Ontario, Canada
Reputation: 23
Excellent

Posted 23 February 2014 - 06:20 AM

Folks,

 

I have some unique code, so cannot figure out how to hide the tab bar.

 

When a user creates a new entry and adds an image - the segue appears to be modal - as the screen bounces up and all tab bar info disappears. (as it should)...

 

HOWEVER, when a user goes to edit an existing entry by selecting one of the image cells, the segue appears to push and without my tab bar disappearing, the "Clear Image" button is under the existing tab bar.

 

So, all my effort has been to remove the tab bar - but nothing seems to work, so was wondering if anyone had any luck moving the clear image button so a user can insert a new pic without having to delete the entire entry.

 

For the record, I have tried the following to remove the tab bar on push:

 

1. SCDetailViewControllerOptions *detailViewControllerOptions;

    detailViewControllerOptions.hidesBottomBarWhenPushed = TRUE;

 

2. self.hidesBottomBarWhenPushed = YES;

 

Any help - greatly appreciated.

 

P.S. the two links that say Cancel and Done in the navbar - perhaps they can be edited to say Clear and Done?



#2 designwerks

designwerks

    Advanced Member

  • STV 5.0 Std
  • PipPipPipPipPip
  • 139 posts
  • LocationKingsville, Ontario, Canada
Reputation: 23
Excellent

Posted 23 February 2014 - 06:27 AM

Figured it out...

 

If anyone else needs this fix here it is - one simple line of additional code...

 

categoryModel.detailViewControllerOptions.presentationMode = SCPresentationModeModal;

 

Entire code may look like this...

 

SCArrayOfObjectsModel *categoryModel = [SCArrayOfObjectsModel

                                             modelWithTableView:self.tableView entityDefinition:taskDef];

    

    categoryModel.detailViewControllerOptions.presentationMode = SCPresentationModeModal;

 

John


  • Everett likes this

#3 Everett

Everett

    Ev

  • STV 5.0 Pro
  • PipPipPipPipPip
  • 191 posts
  • LocationMichigan
Reputation: 60
Outstanding

Posted 23 February 2014 - 03:07 PM

Hi John,

 

Great solution to share.  Just a few comments to extend your answer.

With all the flexibility STV has, it can be confusing how or where to accomplish certain things.

In addition to the solution you found on the model, I thought I'd point out how to accomplish it at a more granular level if needed.

 

 

If you wanted the push effect when you tap on a generated cell and hide the tab bar, then you can do so like this:

 

For the whole tableview:

self.tableview.detailViewController.hidesBottomBarWhenPushed = YES;

Note: at the tableview you cannot set presentationMode.

 

For just a section:

get a reference the section, then:

section.detailViewControllerOptions.hidesBottomBarWhenPushed = YES;

and/or

section.detailViewControllerOptions.presentationMode = SCPresentationModePush  or SCPresentationModeModal, etc.

 

For just a cell:

cell.detailViewControllerOptions.hidesBottomBarWhenPushed = YES;

and/or

cell.detailViewControllerOptions.presentationMode = SCPresentationModePush  or SCPresentationModeModal, etc.

 

Hope that helps.


  • cometlinear likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users