im creating a app that utilises an floating button. i added the floating buttun programmatically in a UITabBarController class, everything works fine.
i want to remove this Floating button in the more tab only
and if theres any way to rename the more button
image
Heres the UITabBarController Code:
override func viewDidLoad() {
super.viewDidLoad()
//LanguageModel.CurrentLanguage = currentlanguage
FloatingBtnSetUpLanguage()
}
private func FloatingBtnSetUpLanguage(){
let actionButton = JJFloatingActionButton()
actionButton.buttonImage = UIImage(named: "lggsmenu")
actionButton.buttonColor = .white
actionButton.addItem(title: "???????", image: UIImage(named: "ar")) { item in
self.changeView(lang: "ar")
}
actionButton.addItem(title: "French", image: UIImage(named: "fr")) { item in
self.changeView(lang: "fr")
}
actionButton.addItem(title: "English", image: UIImage(named: "en")) { item in
self.changeView(lang: "en")
}
view.addSubview(actionButton)
actionButton.translatesAutoresizingMaskIntoConstraints = false
actionButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -16).isActive = true
actionButton.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 10).isActive = true
actionButton.itemAnimationConfiguration = .slideIn(withInterItemSpacing: -100, firstItemSpacing: -75)
}
func changeView(lang: String){
if ModelManager.getInstance().UpdateDefaultLanguage(language: lang){
print("language changed to: (lang)")
LanguageModel.CurrentLanguage = lang
MOLH.setLanguageTo(lang)
if #available(iOS 13.0, *) {
let delegate = UIApplication.shared.delegate as? AppDelegate
delegate!.swichRoot()
} else {
MOLH.reset()
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…