tabbar

Swift - Programmatically refresh constraints

旧时模样 提交于 2021-02-10 06:15:22
问题 My VC starts with stackView attached with Align Bottom to Safe Area . I have tabBar, but in the beginning is hidden tabBar.isHidden = true . Later when the tabBar appears, it hides the stackView So I need function that refresh constraints after tabBar.isHidden = false When I start the app with tabBar.isHidden = false the stackView is shown properly. Tried with every function like: stackView.needsUpdateConstraints() , updateConstraints() , setNeedsUpdateConstraints() without success. Now I'm

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

只谈情不闲聊 提交于 2021-02-07 10:51:39
问题 In UITabBarController, I am placing the tab bar on top of the screen using below code : self.tabBar.frame = CGRectMake(0,0,UIScreen.mainScreen().bounds.width,50) This works perfectly on iOS 10. But when the same app is installed on iOS11. It placing at the bottom only and not moving up. Realy dont know what has changed in iOS11 But How to move tabbar up for iOS 11 回答1: After so much struggle figured out the solution. I was placing the tabBar.frame code inside viewDidAppear which works for iOS

SWIFTUI: Take out a gray rectangle on top of the TabBar

纵饮孤独 提交于 2021-01-28 20:43:09
问题 I have a problem related on my List view. The question is simple: how can I get rid of that wierd gray rectangle showing on top of the TabBar? I didn't code that, I just implemented a controller with a List and NavigationBar and then it showed that thing. For more clear explanation I post the images: ItemRow.swift code: import SwiftUI struct ItemRow: View { static let colors: [String: Color] = ["D": .purple, "G": .orange, "N": .red, "S": .yellow, "V": .pink] var item: MenuItem var body: some