Move Tab Bar to Top of Screen

Swift Placing TabBar on top of the screen not working in iOS 11

After so much struggle figured out the solution.

I was placing the tabBar.frame code inside viewDidAppear which works for iOS 10 and below but to support for iOS 11, need to place inside viewDidLayoutSubviews as shown below which is actually the correct method :

override func viewDidLayoutSubviews()
{
tabBar.frame = CGRectMake(0,0,UIScreen.mainScreen().bounds.width,50)
}

Prevent Tab Bar from being pushed up by keyboard in react Native

Got the answer....
Here

It just suggests wrapping the whole navigator in a fulll screen view.

Is there anyway to move the bottom navigation bar, to the top of the screen instead of the bottom?

You can add this to you appbar:

appbar: AppBar(
flexibleSpace: SalomonBottomBar(
currentIndex: _currentIndex, onTap: (i) => setState(() => _currentIndex = i),
items: [
SalomonBottomBarItem(icon: Icon(Icons.home), title: Text("Home"), selectedColor: Colors.pink, unselectedColor: Colors.white),
SalomonBottomBarItem(icon: Icon(Icons.add), title: Text("Alarm"), selectedColor: Colors.yellow, unselectedColor: Colors.white),
SalomonBottomBarItem(icon: Icon(Icons.timer), title: Text("Stopwatch"), selectedColor: Colors.orange, unselectedColor: Colors.white),
SalomonBottomBarItem(icon: Icon(Icons.watch), title: Text("Timer"), selectedColor: Colors.cyan, unselectedColor: Colors.white)
],
),
)


Related Topics



Leave a reply



Submit