iOS 11 introduces large titles.
Documentation
I created a function in a module :
[code]Public Sub setLargeTitles(extends v As iOSView, value As Boolean)
Static sSystemVersion As Double
//Get sSystemVersion only once
if sSystemVersion = 0.0 then
Declare Function NSClassFromString Lib "Foundation" (clsName As CFStringRef) As ptr
Declare Function currentDevice_ Lib "UIKit.framework" selector "currentDevice" (clsRef As ptr) As ptr
Declare Function systemversion_ Lib "UIKit.framework" selector "systemVersion" (obj_id As ptr) As CFStringRef
Dim device As Ptr = currentDevice_(NSClassFromString("UIDevice"))
Dim systemVersion As Text = systemversion_(device)
Try
sSystemVersion = Double.FromText(systemVersion)
Catch
End Try
End If
//Use new API
If sSystemVersion >= 11.0 Then
Declare Function navigationBar Lib "UIKit.framework" selector "navigationBar" (obj_ref As ptr) As ptr
Declare Function navigationController Lib "UIKit.framework" selector "navigationController" (viewController As ptr) As ptr
Dim navigationControllerRef As ptr = navigationController(v.ViewControllerHandle)
Dim navBar As ptr = navigationBar(navigationControllerRef)
Declare Sub prefersLargeTitles Lib "UIKit.framework" selector "setPrefersLargeTitles:" (obj_id As ptr, value As Boolean)
prefersLargeTitles(navBar, value)
Else
//Not available
End If
End Sub
[/code]
And in an iOSView.Open event, the following code should set the large title:
self.setLargeTitles(true)
Unfortunately it doesn’t work on my iPad with iOS 11.
Is something wrong with my code ?