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
Swipe to Go Back Only Works on Edge of Screen
Member Operator '%' Must Have at Least One Argument of Type 'Viewcontroller'
Firebase - How to Get the Key Value in Observeeventtype = Value
How to Save Tableview Cell's Checkmark After Reload View Use Nsuserdefaults
How to Properly Remove Node When Out of Screen Bounds
Uitapgesturerecognizer on Uiimageview Within Uitablevlewcell Not Getting Called
Is Wkwebview Designed as a Replacement of Uiwebview
Disabling Some Files in Xcode Project from Compilation
How Get the List of Paired Bluetooth Devices in Swift
How to Convert String to Unicode(Utf-8) String in Swift
Swift - Downcast Nsurlresponse to Nshttpurlresponse in Order to Get Response Code
Firebase API Is Not Sending Push Notifications When Using the API
How to Prevent a Remote Notification from Being Displayed