Line above UITabBarController, iOS15

The newly created UITabBarController looks like this.

insert image description here
But what I want is something like this:

insert image description here

After checking this, it needs to be modified through tab.scrollEdgeAppearance.
The specific modification method is as follows:

let appearance = self.tabBar.standardAppearance.copy()
appearance.backgroundColor = .white
appearance.shadowColor = .lightGray // 这个就是顶部的小横线的效果
self.tabBar.scrollEdgeAppearance = appearance

Guess you like

Origin blog.csdn.net/xo19882011/article/details/132144699