Lama
Lama

Reputation: 255

adding child change the button bar tab from RTL to LTR

am using https://github.com/xmartlabs/XLPagerTabStrip in my app .. and its work just fine as i need .. i had 5 children in the buttonbar .. and my app is in Arabic RTL language ... the tab will be like this:

enter image description here

which is the right way to be ..

i have just added the sixth child and it got messed up .. like this:

enter image description here

how to solve this and make it RTL as it was? also is there is a way to make the tabs scrollable so it will not be so crowded and messed up like this?

Upvotes: 1

Views: 218

Answers (1)

Georgio Sayegh
Georgio Sayegh

Reputation: 343

To get the needed behavior, one must the following:

  1. Set the semantic property of your collection view to Force Left to Right
  2. In the override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] method reverse the view controllers array before returning it
  3. In ViewWillAppear go to the last element of the array but make sure to dispatch to the main queue

    DispatchQueue.main.async {
        if(self.itemsList.value.count > 0){
            self.moveToViewController(at: self.itemsList.value.count-1, animated: false)
        }
    
    }
    

Upvotes: 0

Related Questions