Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 60f39ff

Browse files
完成微博个人心中展示
1 parent 55a773d commit 60f39ff

File tree

6 files changed

+95
-13
lines changed

6 files changed

+95
-13
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "我3.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"version" : 1,
19+
"author" : "xcode"
20+
}
21+
}
19.2 KB
Loading[フレーム]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "wbBG.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"version" : 1,
19+
"author" : "xcode"
20+
}
21+
}
251 KB
Loading[フレーム]

‎WRNavigationBar_swift/WRNavigationBar_swift/Demos/MineInfoController.swift‎

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import UIKit
1111

12-
private let IMAGE_HEIGHT:CGFloat = 260
12+
private let IMAGE_HEIGHT:CGFloat = 220
1313
private let NAVBAR_COLORCHANGE_POINT:CGFloat = IMAGE_HEIGHT - CGFloat(kNavBarBottom * 2)
1414

1515
class 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
}

‎WRNavigationBar_swift/WRNavigationBar_swift/Demos/NormalListController.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extension NormalListController: UITableViewDelegate, UITableViewDataSource
4242
var str:String? = nil
4343
switch indexPath.row {
4444
case 0:
45-
str = "主页"
45+
str = "新浪微博个人中心"
4646
case 1:
4747
str = "类似qq应用空间效果"
4848
case 2:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /