Back button v1.5.0.0

I appreciate the new v1.5.0.0 update. It looks great. Is there a way to make a Back style button now on a native toolbar? Sorry if I am missing something.



-Brent

Hi, 


The back button is only available if there is something pushed instead. There is no back button style available in iOS.
You can take a look at the Navigation demo which uses the TTMSFMXNativeUINavigationController and pushes a new view. The back button is then automatically visible to return to the main page.

Kind Regards,
Pieter

How can I add other buttons to the toolbar that is automatically created?

Hi, 


We haven't exposed this yet on the NavigationController, but with some code you can directly add native UIBarButtonItem instances to the toolbar, included is a sample that demonstrates this:

http://www.tmssoftware.net/public/Demo_8.zip

Kind Regards, 
Pieter

Looks great! Thanks for that. Looking forward to this feature.



Do you think we will ever be able to put the iCL controls on FMX controls and vice versa?



-Brent

Hi, 


You can already put FMX Controls inside iCL controls with the component TMSFMXNativeFMXWrapper, you can check out the Form Wrapper demo that is included in the distribution. 

The other way around will not be possible, since each FireMonkey control is actually drawn on the root view, so they aren't containers that can hold native iOS controls. Also, whatever hierarchy you come up with in a FireMonkey application, FireMonkey controls will always be drawn under TMS iCL controls.

Kind Regards, 
Pieter

Pieter Scheldeman2013-07-11 10:40:12

Ok thanks Pieter!



-Brent

Hallo Pieter,

I have checked the code of your Demo_8.zip and it works fine. However, if I set buttons to the left (ViewController.navigationItem.setLeftBarButtonItems(arr);) the automatically added back button of the NavigationController is no longer present. Do you know how to add buttons to the left and keep the back button working?

Hi,

There is a new property

But it's currently not implemented yet in our code.

You can modify it in FMX.TMSNativeUICore.pas

  UINavigationControllerClass = interface(UIViewControllerClass)
    ['{144258EB-46EF-4CE3-8399-26B585EE5D51}']
  end;
  UINavigationController = interface(UIViewController)
    ['{BC0A62FD-B83A-4313-AABC-797C7BD64366}']
    function delegate: Pointer; cdecl;
    function initWithRootViewController(rootViewController: UIViewController): Pointer; cdecl;
    function isNavigationBarHidden: Boolean; cdecl;
    function isToolbarHidden: Boolean; cdecl;
    function navigationBar: UINavigationBar; cdecl;
    function popToRootViewControllerAnimated(animated: Boolean): NSArray; cdecl;
    function popToViewController(viewController: UIViewController; animated: Boolean): NSArray; cdecl;
    function popViewControllerAnimated(animated: Boolean): UIViewController; cdecl;
    procedure pushViewController(viewController: UIViewController; animated: Boolean); cdecl;
    procedure setDelegate(delegate: Pointer); cdecl;
    procedure setNavigationBarHidden(navigationBarHidden: Boolean); cdecl; overload;
    procedure setNavigationBarHidden(hidden: Boolean; animated: Boolean); cdecl; overload;
    procedure setToolbarHidden(toolbarHidden: Boolean); cdecl; overload;
    procedure setToolbarHidden(hidden: Boolean; animated: Boolean); cdecl; overload;
    procedure setViewControllers(viewControllers: NSArray); cdecl; overload;
    procedure setViewControllers(viewControllers: NSArray; animated: Boolean); cdecl; overload;
    procedure setLeftItemsSupplementBackButton(leftItemsSupplementBackButton: Boolean); cdecl;
    function leftItemsSupplementBackButton: Boolean; cdecl; 
    function toolbar: UIToolbar; cdecl;
    function topViewController: UIViewController; cdecl;
    function viewControllers: NSArray; cdecl;
    function visibleViewController: UIViewController; cdecl;
  end;
  TUINavigationController = class(TOCGenericImport<UINavigationControllerClass, UINavigationController>)  end;

and then access it the same way you use setLeftBarButtonItems and set it to true

Thank you, works like a charm!

1 Like