- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我已经成功地实现了以图像为图标的 Carbon Kit 可滚动 TabBar。我遇到的问题是当我回击时。图标将在页面上保留一段时间,然后消失。有没有办法让它们立即消失。如果我点击底部的标签栏。这件事不会发生。请帮忙
import UIKit
import CarbonKit
class Result: UIViewController, CarbonTabSwipeNavigationDelegate {
var sURL : String = ""
override func viewDidLoad() {
super.viewDidLoad()
print( " From Home VC : ", sURL)
//===== substring the URL to get the screen Name=============
let startIndex = sURL.range(of: "result_")?.upperBound
let startString = sURL.substring(from: startIndex!) //===startString: let endIndex = startString.range(of: ".")!.lowerBound //===endIndex:
var sScreen = startString.substring(to: endIndex)
//=================================================================
let iconNames = ["0mag", "1dmc", "2toto","3sg", "4lotto", "5cs", "6stc","7m101"]
var images = [UIImage]()
for icon in iconNames {
if let img = UIImage(named: icon)?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal) {
images.append(img)
}
}
let carbonTabSwipeNavigation = CarbonTabSwipeNavigation(items: images, delegate: self)
//carbonTabSwipeNavigation.pagesScrollView?.isScrollEnabled = false
carbonTabSwipeNavigation.insert(intoRootViewController: self)
carbonTabSwipeNavigation.setTabExtraWidth(20)
carbonTabSwipeNavigation.setTabBarHeight(100)
carbonTabSwipeNavigation.toolbar.barTintColor = UIColor.black
carbonTabSwipeNavigation.toolbar.isTranslucent=true
var iIndex = UInt()
if(sScreen=="mag"){
iIndex = 0
}else if(sScreen=="dmc"){
iIndex = 1
}else if(sScreen=="toto"){
iIndex = 2
}else if(sScreen=="sg"){
iIndex = 3
}else if(sScreen=="lotto"){
iIndex = 4
}else if(sScreen=="stc"){
iIndex = 5
}else if(sScreen=="cs"){
iIndex = 6
}else if(sScreen=="m101"){
iIndex = 7
}
print("The iIndex: ", iIndex)
carbonTabSwipeNavigation.setCurrentTabIndex(iIndex, withAnimation: true)
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
}
func carbonTabSwipeNavigation(_ carbonTabSwipeNavigation: CarbonTabSwipeNavigation, viewControllerAt index: UInt) -> UIViewController {
var screen = UIViewController()
print("What is the index: " , index)
if (index == 0){
screen = self.storyboard?.instantiateViewController( withIdentifier: "magnum4D" ) as! Magnum4D
}else if (index == 1){
screen = self.storyboard?.instantiateViewController( withIdentifier: "dmc" ) as! DMC
}else if (index == 2){
screen = self.storyboard?.instantiateViewController( withIdentifier: "toto" ) as! Toto
}else if (index == 3){
screen = self.storyboard?.instantiateViewController( withIdentifier: "sg" ) as! SG
}else if (index == 4){
screen = self.storyboard?.instantiateViewController( withIdentifier: "lotto" ) as! Lotto
}else if (index == 5){
screen = self.storyboard?.instantiateViewController( withIdentifier: "stc" ) as! STC
}else if (index == 6){
screen = self.storyboard?.instantiateViewController( withIdentifier: "cs" ) as! CS
}else if (index == 7){
screen = self.storyboard?.instantiateViewController( withIdentifier: "m101" ) as! M101
}
print(" What screen is called ", screen)
return screen
}
}
最佳答案
那些是当前在 View 边界之外的菜单项。因此,“view.clipToBounds = true”应该有效。
您还可以尝试在调用“viewWillDissapear”时将菜单项的 alpha 设置/设置为 0。
关于IOS-Swift, CarbonKit 被打回来时,Icons 还在pager 停留了一会儿,如何让它们立即消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53758729/
在我看来,这是我添加 Carbon 套件的代码。 let arrMenuName = ["Signal","Buy or Not"] carbonSwipe.delegate = se
我希望两个选项卡 (Hello World, Tab) 的宽度与 Controller 宽度相等。我把我的标签的完整代码。如果有人对此有建议。请给建议。我在等。快速评论和回答。 import UIKi
我正在使用 ermalkaleci 的 Carbonkit 的 CarbonTabSwipeNavigation,当 View 加载时, View Controller 正确对齐,然后当切换到第二个
我是 iOS 新手。我想在 CarbonTabSwipeNavigation 上应用渐变颜色。我尝试将渐变应用到 CarbonTabSwipeNavigation 的工具栏,但它没有发生我试过静态颜色
我已经成功地实现了以图像为图标的 Carbon Kit 可滚动 TabBar。我遇到的问题是当我回击时。图标将在页面上保留一段时间,然后消失。有没有办法让它们立即消失。如果我点击底部的标签栏。这件事不
我是一名优秀的程序员,十分优秀!