新建的UITabBarController是下面这个样子的。

但是想要的是如下的形式:

查了一下这个要通过 tab.scrollEdgeAppearance 来修改。
具体修改方式如下:
let appearance = self.tabBar.standardAppearance.copy()
appearance.backgroundColor = .white
appearance.shadowColor = .lightGray // 这个就是顶部的小横线的效果
self.tabBar.scrollEdgeAppearance = appearance















![[C++] KY79 浮点数加法 北京大学复试上机题](https://img-blog.csdnimg.cn/img_convert/b034a3bfade546a4fe63d4d64bcbe79e.webp?x-oss-process=image/format,png)



