Comments (5)
`override func viewDidLoad() {
super.viewDidLoad()
let tc = TabPageViewController.create()
let vc1 = UIViewController()
vc1.view.backgroundColor = UIColor(red: 251/255, green: 252/255, blue: 149/255, alpha: 1.0)
let vc2 = UIViewController()
vc2.view.backgroundColor = UIColor(red: 252/255, green: 150/255, blue: 149/255, alpha: 1.0)
let vc3 = UIViewController()
vc3.view.backgroundColor = UIColor(red: 149/255, green: 218/255, blue: 252/255, alpha: 1.0)
let vc4 = UIViewController()
vc4.view.backgroundColor = UIColor(red: 149/255, green: 252/255, blue: 197/255, alpha: 1.0)
let vc5 = UIViewController()
vc5.view.backgroundColor = UIColor(red: 252/255, green: 182/255, blue: 106/255, alpha: 1.0)
tc.tabItems = [(vc1, "Mon."), (vc2, "Tue."), (vc3, "Wed."), (vc4, "Thu."), (vc5, "Fri.")]
var option = TabPageOption()
//option.tabWidth = view.frame.width / CGFloat(tc.tabItems.count)
tc.option = option
self.addChildViewController(tc)
self.view.addSubview(tc.view)
// Configure Child View
tc.view.frame = view.bounds
tc.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
// Notify Child View Controller
tc.didMove(toParentViewController: self)
// Do any additional setup after loading the view.
}`
To add to any custom view controller, first create a container view in custom view controller and then create a controller for that container and place the code as you see in the controller for that container. It should work like a CHARM!
from tabpageviewcontroller.
same problem
from tabpageviewcontroller.
Do you want to use the TabPageViewController to the RootViewController?
from tabpageviewcontroller.
Same problem, yes would it be possible to add it as RootviewController
from tabpageviewcontroller.
@ghass64 @dp4dileep @janaraj
i faced same problem and i wanted to show it as RootviewController
after some tries i solved it
by using addChildViewController not pushViewController
((
navigationController?.addChildViewController(tabPageViewController)
))
from tabpageviewcontroller.
Related Issues (20)
- How set separator line color? I use cartage to import framework.
- Please help to get this started. HOT 3
- Type 'TabPageViewController' has no member 'create'; did you mean 'prepare'?
- Is TabPageViewController able to customize the tab looks like round corner rectangle?
- 程序崩溃
- The tab bar doesn't fill to the top of the screen
- Endless Scroll Pagination Support?
- Does this tabpageViewcontroller support dynamic tab
- Fix Right to left language support HOT 1
- Retain Navigation Bar Appearance HOT 1
- any cell phone will do?
- 少ない数のタブメニューを画面いっぱいにしたい HOT 2
- Right to left support HOT 1
- errors after pod installation (Xcode 9.3.1) HOT 2
- How to embed the tabView in navigationBar
- add Image and Title
- Feature Wanted
- CFBundleVersion is Invalid
- load
- Detect when tab VC is loaded
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tabpageviewcontroller.