Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3d32af91
由
cgx
编写于
2022-04-25 21:45:09 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
头像图片黑夜模式适配
1 个父辈
9bbde2ef
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
20 行增加
和
17 行删除
DreamSleep/DreamSleep/Profile/Account/NickNameController.m
DreamSleep/DreamSleep/Profile/Account/UserInfoView.m
DreamSleep/DreamSleep/Profile/Account/NickNameController.m
查看文件 @
3d32af9
...
...
@@ -94,6 +94,7 @@
-
(
UIImageView
*
)
portraitIV
{
if
(
!
_portraitIV
)
{
_portraitIV
=
[
UIImageView
new
];
_portraitIV
.
dk_alphaPicker
=
DKAlphaPickerWithAlphas
(
1
,
.
5
,
.
5
);
[
_portraitIV
yy_setImageWithURL
:[
NSURL
URLWithString
:[
LoginUtils
getFaceImg
]]
placeholder
:[
UIImage
imageNamed
:
@"portrait"
]];
[
_portraitIV
cornerRadius
:
145
/
2
.
0
];
}
...
...
@@ -103,6 +104,7 @@
-
(
UIImageView
*
)
cameraIV
{
if
(
!
_cameraIV
)
{
_cameraIV
=
[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:
@"cameraIcon"
]];
_cameraIV
.
dk_alphaPicker
=
DKAlphaPickerWithAlphas
(
1
,
.
5
,
.
5
);
}
return
_cameraIV
;
}
...
...
DreamSleep/DreamSleep/Profile/Account/UserInfoView.m
查看文件 @
3d32af9
...
...
@@ -13,7 +13,7 @@
#import "UserRequestModel.h"
@interface
UserInfoView
()
<
InfoModifyAlertViewDelegate
,
DSImagePickerControllerDelegate
,
RSKImageCropViewControllerDelegate
>
@property
(
nonatomic
,
strong
)
UI
Button
*
portraitBtn
;
@property
(
nonatomic
,
strong
)
UI
ImageView
*
portraitIV
;
@property
(
nonatomic
,
strong
)
InfoModifyAlertView
*
photoAlertView
;
@property
(
nonatomic
,
strong
)
UserInfoTableView
*
userInfoTV
;
@property
(
nonatomic
,
strong
)
UIButton
*
layoutBtn
;
...
...
@@ -25,7 +25,7 @@
if
(
self
=
[
super
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
kScreenHeight
-
kTopHeight
(
0
))])
{
_delegate
=
delegate
;
[
self
.
portrait
Btn
yy_setImageWithURL
:[
NSURL
URLWithString
:[
LoginUtils
getFaceImg
]]
forState
:
UIControlStateNormal
placeholder
:
[
UIImage
imageNamed
:
@"portrait"
]];
[
self
.
portrait
IV
yy_setImageWithURL
:[
NSURL
URLWithString
:[
LoginUtils
getFaceImg
]]
placeholder
:[
UIImage
imageNamed
:
@"portrait"
]];
[
self
addSubview
:
self
.
userInfoTV
];
[
self
addSubview
:
self
.
layoutBtn
];
...
...
@@ -77,33 +77,34 @@
// 用户头像上传成功后存入沙盒(暂不处理)
if
(
requestModel
.
resCode
==
DSResCodeSuccess
)
{
[
DSProgressHUD
showToast
:
@"修改成功"
];
[
self
.
portraitBtn
setImage
:
croppedImage
forState
:
UIControlStateNormal
]
;
self
.
portraitIV
.
image
=
croppedImage
;
[
self
.
ds_viewController
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}
}];
}
#pragma mark - lazy
-
(
UI
Button
*
)
portraitBtn
{
if
(
!
_portrait
Btn
)
{
-
(
UI
ImageView
*
)
portraitIV
{
if
(
!
_portrait
IV
)
{
CGFloat
top
=
iPhone5
?
40
:
83
;
_portrait
Btn
=
[[
UIButton
alloc
]
initWithFrame
:
CGRectMake
(
0
,
top
,
145
,
145
)];
_portrait
Btn
.
centerX
=
self
.
centerX
;
[
_portraitBtn
addTarget
:
self
action
:
@selector
(
updatePortraitAction
)
forControlEvents
:
UIControlEventTouchUpInside
]
;
_portrait
Btn
.
imageView
.
contentMode
=
UIViewContentModeScaleAspectFit
;
_portraitBtn
.
contentHorizontalAlignment
=
UIControlContentHorizontalAlignmentFill
;
_portraitBtn
.
contentVerticalAlignment
=
UIControlContentVerticalAlignmentFill
;
[
_portrait
Btn
cornerRadius
:
145
/
2
.
0
];
[
self
addSubview
:
_portrait
Btn
];
_portrait
IV
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
top
,
145
,
145
)];
_portrait
IV
.
centerX
=
self
.
centerX
;
_portraitIV
.
userInteractionEnabled
=
YES
;
_portrait
IV
.
dk_alphaPicker
=
DKAlphaPickerWithAlphas
(
1
,
.
5
,
.
5
)
;
UITapGestureRecognizer
*
tapGR
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
updatePortraitAction
)]
;
[
_portraitIV
addGestureRecognizer
:
tapGR
]
;
[
_portrait
IV
cornerRadius
:
145
/
2
.
0
];
[
self
addSubview
:
_portrait
IV
];
UIImageView
*
cameraIV
=
[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:
@"cameraIcon"
]];
cameraIV
.
dk_alphaPicker
=
DKAlphaPickerWithAlphas
(
1
,
.
5
,
.
5
);
[
self
addSubview
:
cameraIV
];
[
cameraIV
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
_portrait
Btn
).
offset
(
-
6
);
make
.
bottom
.
equalTo
(
_portrait
Btn
).
offset
(
-
6
);
make
.
right
.
equalTo
(
_portrait
IV
).
offset
(
-
6
);
make
.
bottom
.
equalTo
(
_portrait
IV
).
offset
(
-
6
);
}];
}
return
_portrait
Btn
;
return
_portrait
IV
;
}
-
(
InfoModifyAlertView
*
)
photoAlertView
{
...
...
@@ -115,7 +116,7 @@
-
(
UserInfoTableView
*
)
userInfoTV
{
if
(
!
_userInfoTV
)
{
_userInfoTV
=
[[
UserInfoTableView
alloc
]
initWithFrame
:
CGRectMake
(
15
,
CGRectGetMaxY
(
self
.
portrait
Btn
.
frame
)
+
60
,
kScreenWidth
-
30
,
150
)
style
:
UITableViewStylePlain
];
_userInfoTV
=
[[
UserInfoTableView
alloc
]
initWithFrame
:
CGRectMake
(
15
,
CGRectGetMaxY
(
self
.
portrait
IV
.
frame
)
+
60
,
kScreenWidth
-
30
,
150
)
style
:
UITableViewStylePlain
];
}
return
_userInfoTV
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论