代码连接 TODO:
platform :ios, ‘13.0’
use_frameworks!
target 'DemoApp' do
source 'https://github.com/CocoaPods/Specs.git'
pod 'expanding-collection'
end
- 还要下载 文件:
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
yeTye()
return true
}
func yeTye(){
// 清除导航条的阴影图片:
UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().isTranslucent = true //透明样式;
// 阴影:
let shadow = NSShadow()
shadow.shadowOffset = CGSize(width: 0, height: 2)
shadow.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1)
// 设置导航条:
UINavigationBar.appearance().titleTextAttributes = [
NSAttributedString.Key.foregroundColor : UIColor.white,
NSAttributedString.Key.shadow: shadow
]
}
//...
}
- UI