0

XLPagerTabStrip: Dynamically adding subviews to tab's view controllers wouldn't display except under first tab.

Please download the project and run it to see the problem:

https://github.com/farhan101/TheProblemView

First Tab: Under View One tab you can see a spinner added dynamically

First Tab

Second Tab: Under View Two tab same spinner is added but it wouldn't show Second Tab

PS: As you can see in the source code, both view controllers are instances of the same view controller class.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Farhan Arshad
  • 375
  • 3
  • 9

1 Answers1

1

You need to use the parent view's bounds instead of frame while creating ViewToAdd.

let vu = ViewToAdd(frame: self.view.bounds, yFactor: 2.0)
Kamran
  • 14,987
  • 4
  • 33
  • 51