You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes when having in most cases 2 or more Pages when the content is based dynamically on a server and some page fails you might have ended up in 1 viewController.
I see in your code you simply hide the segment.
i simply fixed this for me
/// Height of segmented indicator
/// Get only
open var scrollIndicatorHeight: CGFloat {
return viewControllers.count <= 1 ? perferredScrollIndicatorHeight : perferredScrollIndicatorHeight
}
/// Height of segmented control bar
/// Get only
open var segmentedControlHeight: CGFloat {
return viewControllers.count <= 1 ? preferredSegmentedControlHeight : preferredSegmentedControlHeight
}
Maybe there should be an option to show the segment in case it fails to 1 viewController in order to show the title to the user to know which page is he currently on.
What do you think?
The text was updated successfully, but these errors were encountered:
@alexookah My recommendation is that when you use DTPagerController, always subclass it, create your own, customise everything in your class and use it throughout your application. For example, you can do something like this instead of changing directly in my source code:
class PagerController: DTPagerController {
// Fixed scroll indicator height
override var scrollIndicatorHeight: CGFloat {
return perferredScrollIndicatorHeight
}
// Fixed segmented control height
override var segmentedControlHeight: CGFloat {
return preferredSegmentedControlHeight
}
override init(viewControllers: [UIViewController]) {
super.init(viewControllers: viewControllers)
// Other customizations
font = UIFont.customFont(15)
selectedFont = UIFont.boldCustomFont(15)
}
}
Sometimes when having in most cases 2 or more Pages when the content is based dynamically on a server and some page fails you might have ended up in 1 viewController.
I see in your code you simply hide the segment.
i simply fixed this for me
/// Height of segmented indicator
/// Get only
open var scrollIndicatorHeight: CGFloat {
return viewControllers.count <= 1 ? perferredScrollIndicatorHeight : perferredScrollIndicatorHeight
}
/// Height of segmented control bar
/// Get only
open var segmentedControlHeight: CGFloat {
return viewControllers.count <= 1 ? preferredSegmentedControlHeight : preferredSegmentedControlHeight
}
Maybe there should be an option to show the segment in case it fails to 1 viewController in order to show the title to the user to know which page is he currently on.
What do you think?
The text was updated successfully, but these errors were encountered: