iOS Question Problem getting height of NavigationBar ?

Discussion in 'iOS Questions' started by henrywood, May 9, 2015.

  1. henrywood

    henrywood Active Member Licensed User

    I am trying to get the height of the NavigationBar (don't want to hardcode any values).
    I've tried:

    Code:
    Dim NativeMe2 As NativeObject = Main.NavControl
      
    ' self.navigationController.navigationBar.frame.size.height;
      Dim NativeMe3 As NativeObject = NativeMe2.GetField("navigationBar").GetField("frame").GetField("size").GetField("height")
      
    Dim h As Object = NativeMe3.AsNumber
    I am getting this error:

    Any ideas what's wrong ?


    /Henrik
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Why do you need this code? Handle Page_Resized event and you will get the correct values.
     
  3. henrywood

    henrywood Active Member Licensed User

    Well the code is in a shared, reusable code module so all code related to the functionality of the shared module should be contained within it.
    But did you mean to say that you can have multiple Page_Resized Handlers in multiple code modules ?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You cannot have multiple handlers. However the correct way to find the page size is by handling Page_Resize event. You can call any sub you like from this event.
     
  5. henrywood

    henrywood Active Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice