SplitView Question

  1. 7 months ago

    Martin T

    24 Jan 2019 Pre-Release Testers Germany

    Hi,

    if you look at these screenshot, are iOSTables with round corners in Xojo possible? Does anyone have a declare?

    -image-

    And, is it possible to show/hide a split view in landscape mode? This is possible in iAWriter or Ulysses (fifth button from the right side) via Toolbutton Click.

    -image-

  2. Jeremie L

    24 Jan 2019 Pre-Release Testers, Xojo Pro, XDC Speakers Europe (France) - getpackr.io

    Yes both are possible.
    I'll check the declares I have when I get back to my Mac

  3. Jeremie L

    24 Jan 2019 Pre-Release Testers, Xojo Pro, XDC Speakers Europe (France) - getpackr.io
    Edited 7 months ago

    Actually rounded corners on grouped cells like the Settings app is very complicated. I do not have a Xojo solution for this.
    https://stackoverflow.com/questions/18822619/ios-7-tableview-like-in-settings-app-on-ipad

    I only have a solution for setting the entire table rounded corners.

    Declare Function layer_ Lib UIKitLib selector "layer" (id As ptr) As Ptr
    Dim layer As ptr = layer_(table.Handle)
    
    Declare Sub setCornerRadius Lib QuartzCoreLib selector "setCornerRadius:" (id As ptr, value As CGFloat)
    
    setCornerRadius layer, 8
    
    Declare Sub clipsToBounds Lib UIKitLib selector "setClipsToBounds:" (id As ptr, value As Boolean)
    clipsToBounds(table.Handle, True)

    ---
    To hide the left panel in a split view add this enumeration in a module

    Protected Enum UISplitViewControllerDisplayMode
    Automatic
    PrimaryHidden
    AllVisible
    PrimaryOverlay
    End Enum

    And then this function

    Public Sub SetDisplayMode(Extends scr As iOSSplitView, mode As UISplitViewControllerDisplayMode)
      //Changes the SplitView in portrait mode
      
      Declare Sub setPreferredDisplayMode Lib "UIKit" _
      selector "setPreferredDisplayMode:" (obj As Ptr, mode As UISplitViewControllerDisplayMode)
      
      setPreferredDisplayMode(scr.ViewControllerHandle, mode)
      
    End Sub

    Or you could just use iOSDesignExtensions https://github.com/jkleroy/iOSDesignExtensions

  4. Martin T

    24 Jan 2019 Pre-Release Testers Germany
    Edited 7 months ago

    Thanks for your input Jeremy. I already use your pretty cool iOSDesignExtensions. Could you please create a small sample project with both declares? Using SetDisplayMode within a View crashes the App:

    iOSSplitView(App.CurrentScreen.Content).SetDisplayMode(ViewExtensionsXC.UISplitViewControllerDisplayMode.PrimaryHidden)
  5. Jeremie L

    24 Jan 2019 Pre-Release Testers, Xojo Pro, XDC Speakers Europe (France) - getpackr.io

    I copy pasted your code into a new project, imported iOSDesignExtensions and I don't experience any crash.

    https://www.jeremieleroy.com/upload/split.xojo_binary_project

or Sign Up to reply!