99
1010import UIKit
1111
12- private let IMAGE_HEIGHT : CGFloat = 260
12+ private let IMAGE_HEIGHT : CGFloat = 220
1313private let NAVBAR_COLORCHANGE_POINT : CGFloat = IMAGE_HEIGHT - CGFloat( kNavBarBottom * 2 )
1414
1515class MineInfoController : UIViewController
@@ -21,28 +21,66 @@ class MineInfoController: UIViewController
2121 table. dataSource = self
2222 return table
2323 } ( )
24- lazy var imageView : UIImageView = {
25- let imgView = UIImageView ( image: UIImage ( named: " image4 " ) )
26- imgView. frame. size = CGSize ( width: 100 , height: 100 )
27- imgView. layer. cornerRadius = 50
24+ lazy var iconView : UIImageView = {
25+ let imgView = UIImageView ( image: UIImage ( named: " image5 " ) )
26+ imgView. frame. size = CGSize ( width: 80 , height: 80 )
27+ imgView. layer. borderColor = UIColor . white. cgColor
28+ imgView. layer. borderWidth = 2
29+ imgView. layer. cornerRadius = 40
2830 imgView. layer. masksToBounds = true
2931 return imgView
3032 } ( )
31- lazy var topView : UIView = {
32- let view = UIView ( frame: CGRect ( x: 0 , y: 0 , width: kScreenWidth, height: IMAGE_HEIGHT) )
33- view. backgroundColor = UIColor . orange
34- return view
33+ lazy var nameLabel : UILabel = {
34+ let label = UILabel ( )
35+ label. backgroundColor = UIColor . clear
36+ label. textColor = UIColor . white
37+ label. text = " wangrui460 "
38+ label. textAlignment = . center
39+ label. font = . systemFont( ofSize: 17 )
40+ return label
41+ } ( )
42+ lazy var fansLabel : UILabel = {
43+ let label = UILabel ( )
44+ label. backgroundColor = UIColor . clear
45+ label. textColor = UIColor . white
46+ label. text = " 关注 121 | 粉丝 17 "
47+ label. textAlignment = . center
48+ label. font = . boldSystemFont( ofSize: 14 )
49+ return label
50+ } ( )
51+ lazy var detailLabel : UILabel = {
52+ let label = UILabel ( )
53+ label. backgroundColor = UIColor . clear
54+ label. textColor = UIColor . white
55+ label. text = " 简介:丽人丽妆公司,熊猫美妆APP iOS工程师 "
56+ label. textAlignment = . center
57+ label. font = . systemFont( ofSize: 13 )
58+ return label
59+ } ( )
60+ lazy var topView : UIImageView = {
61+ let imgView = UIImageView ( image: UIImage ( named: " wbBg " ) )
62+ imgView. frame = CGRect ( x: 0 , y: 0 , width: kScreenWidth, height: IMAGE_HEIGHT)
63+ imgView. contentMode = UIViewContentMode . scaleAspectFill
64+ imgView. clipsToBounds = true
65+ return imgView
3566 } ( )
3667
3768 override func viewDidLoad( )
3869 {
3970 super. viewDidLoad ( )
40- title = " 个人中心 "
71+ title = " "
4172 view. backgroundColor = UIColor . red
4273 view. addSubview ( tableView)
43- topView. addSubview ( imageView)
44- imageView. center = topView. center
74+ topView. addSubview ( iconView)
75+ iconView. center = CGPoint ( x: topView. center. x, y: topView. center. y - 10 )
76+ topView. addSubview ( nameLabel)
77+ nameLabel. frame = CGRect ( x: 0 , y: iconView. frame. size. height+ iconView. frame. origin. y+ 6 , width: kScreenWidth, height: 19 )
78+ topView. addSubview ( fansLabel)
79+ fansLabel. frame = CGRect ( x: 0 , y: nameLabel. frame. origin. y+ 19 + 5 , width: kScreenWidth, height: 16 )
80+ topView. addSubview ( detailLabel)
81+ detailLabel. frame = CGRect ( x: 0 , y: fansLabel. frame. origin. y+ 16 + 5 , width: kScreenWidth, height: 15 )
4582 tableView. tableHeaderView = topView
83+ navigationItem. rightBarButtonItem = UIBarButtonItem ( title: " ··· " , style: . done, target: nil , action: nil )
4684
4785 // 设置导航栏颜色
4886 navBarBarTintColor = UIColor . init ( red: 247 / 255.0 , green: 247 / 255.0 , blue: 247 / 255.0 , alpha: 1.0 )
@@ -74,13 +112,15 @@ extension MineInfoController
74112 navBarTintColor = UIColor . black. withAlphaComponent ( alpha)
75113 navBarTitleColor = UIColor . black. withAlphaComponent ( alpha)
76114 statusBarStyle = . default
115+ title = " wangrui460 "
77116 }
78117 else
79118 {
80119 navBarBackgroundAlpha = 0
81120 navBarTintColor = . white
82121 navBarTitleColor = . white
83122 statusBarStyle = . lightContent
123+ title = " "
84124 }
85125 }
86126}
0 commit comments