我在AppDelegate中这样配置我的navigationBar:
[1,100,1000,10000] = [1,100,10000]
这很好,但是当我按如下所示设置标题时:
private fun <E> List<E>.filterDownBy(perc: Int): List<E> {
val distro = this.size / ((perc * this.size) / 100)
if (perc == 0 || distro >= this.size)
return this
return this.filterIndexed { index, _ -> (index % distro) != 0 }
这永远都行不通,而且我看不到任何标题。不管我将上面的行放在何处(viewDidLoad,viewDidAppear等)
答案 0 :(得分:2)
尝试将视图控制器的title属性设置为“ Hello”
self.title = "Hello"
如果可行,您可以在Swift - Title Not Appearing for Navigation View Controller
的AWebster答案中找到解释。