修改了个人资料页的蒙版的效果

This commit is contained in:
fengshuo
2021-09-27 11:15:28 +08:00
parent c9dd6001b4
commit 45a5a38a2a
21 changed files with 637 additions and 72 deletions

View File

@@ -121,6 +121,9 @@
E824546126F5F4E400BE8163 /* XPMineResetPayPwdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E824546026F5F4E400BE8163 /* XPMineResetPayPwdViewController.m */; };
E824546426F5FF1C00BE8163 /* XPMineResetPayPasswordPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E824546326F5FF1C00BE8163 /* XPMineResetPayPasswordPresenter.m */; };
E824546626F5FF6000BE8163 /* XPMineResetPayPasswordProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E824546526F5FF5100BE8163 /* XPMineResetPayPasswordProtocol.h */; };
E865963F27015A9C00846EBD /* XPMineUserTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = E865963E27015A9C00846EBD /* XPMineUserTableView.m */; };
E86596432701611A00846EBD /* UIImage+ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = E86596412701611A00846EBD /* UIImage+ImageEffects.m */; };
E86596462701612D00846EBD /* UIImageView+Vague.m in Sources */ = {isa = PBXBuildFile; fileRef = E86596452701612D00846EBD /* UIImageView+Vague.m */; };
E872308926E89BE000B90D4F /* LoginPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E872308826E89BE000B90D4F /* LoginPhoneViewController.m */; };
E872308D26E89DAA00B90D4F /* LoginInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = E872308C26E89DAA00B90D4F /* LoginInputView.m */; };
E872309326E8D31500B90D4F /* LoginVerifCodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E872309226E8D31500B90D4F /* LoginVerifCodeView.m */; };
@@ -421,6 +424,12 @@
E824546226F5FF1C00BE8163 /* XPMineResetPayPasswordPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineResetPayPasswordPresenter.h; sourceTree = "<group>"; };
E824546326F5FF1C00BE8163 /* XPMineResetPayPasswordPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineResetPayPasswordPresenter.m; sourceTree = "<group>"; };
E824546526F5FF5100BE8163 /* XPMineResetPayPasswordProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineResetPayPasswordProtocol.h; sourceTree = "<group>"; };
E865963D27015A9C00846EBD /* XPMineUserTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserTableView.h; sourceTree = "<group>"; };
E865963E27015A9C00846EBD /* XPMineUserTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserTableView.m; sourceTree = "<group>"; };
E86596412701611A00846EBD /* UIImage+ImageEffects.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ImageEffects.m"; sourceTree = "<group>"; };
E86596422701611A00846EBD /* UIImage+ImageEffects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+ImageEffects.h"; sourceTree = "<group>"; };
E86596442701612D00846EBD /* UIImageView+Vague.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImageView+Vague.h"; sourceTree = "<group>"; };
E86596452701612D00846EBD /* UIImageView+Vague.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+Vague.m"; sourceTree = "<group>"; };
E872308726E89BE000B90D4F /* LoginPhoneViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginPhoneViewController.h; sourceTree = "<group>"; };
E872308826E89BE000B90D4F /* LoginPhoneViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginPhoneViewController.m; sourceTree = "<group>"; };
E872308B26E89DAA00B90D4F /* LoginInputView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginInputView.h; sourceTree = "<group>"; };
@@ -874,6 +883,7 @@
189DD56C26DF5B5400AB55B1 /* UI */ = {
isa = PBXGroup;
children = (
E8659640270160F200846EBD /* VagueImageView */,
E8AC720A26F435AF007D6E91 /* UIImageView */,
E81366F926F0D27A0076364C /* UIButton */,
E82109B126F2050D00FC3319 /* UIImage */,
@@ -1164,6 +1174,17 @@
path = UIImage;
sourceTree = "<group>";
};
E8659640270160F200846EBD /* VagueImageView */ = {
isa = PBXGroup;
children = (
E86596422701611A00846EBD /* UIImage+ImageEffects.h */,
E86596412701611A00846EBD /* UIImage+ImageEffects.m */,
E86596442701612D00846EBD /* UIImageView+Vague.h */,
E86596452701612D00846EBD /* UIImageView+Vague.m */,
);
path = VagueImageView;
sourceTree = "<group>";
};
E872308A26E89D5100B90D4F /* CustomView */ = {
isa = PBXGroup;
children = (
@@ -1223,10 +1244,14 @@
E88B5CC226FB429C00DA9178 /* MineInfo */ = {
isa = PBXGroup;
children = (
E8EEB8FC26FC2DF8007C6EBA /* XPMineUserInfoCustomNavView.h */,
E8EEB8FD26FC2DF8007C6EBA /* XPMineUserInfoCustomNavView.m */,
E88B5CC326FB42B000DA9178 /* XPMineUserInfoHeaderView.h */,
E88B5CC426FB42B000DA9178 /* XPMineUserInfoHeaderView.m */,
E8EEB91B26FC9D58007C6EBA /* XPMineUserInfoDateView.h */,
E8EEB91C26FC9D58007C6EBA /* XPMineUserInfoDateView.m */,
E865963D27015A9C00846EBD /* XPMineUserTableView.h */,
E865963E27015A9C00846EBD /* XPMineUserTableView.m */,
);
path = MineInfo;
sourceTree = "<group>";
@@ -1503,8 +1528,6 @@
children = (
E8EEB8F926FC2874007C6EBA /* XPMineUserInfoTableViewCell.h */,
E8EEB8FA26FC2874007C6EBA /* XPMineUserInfoTableViewCell.m */,
E8EEB8FC26FC2DF8007C6EBA /* XPMineUserInfoCustomNavView.h */,
E8EEB8FD26FC2DF8007C6EBA /* XPMineUserInfoCustomNavView.m */,
E8EEB90726FC579A007C6EBA /* XPMineUserInfoEditTableViewCell.h */,
E8EEB90826FC579A007C6EBA /* XPMineUserInfoEditTableViewCell.m */,
E8B846C026FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.h */,
@@ -1673,6 +1696,7 @@
E88B5CB526FB20B800DA9178 /* XPMineTeenagerPwdView.m in Sources */,
E81C279826EB3AC40031E639 /* LoginForgetPasswordProtocol.h in Sources */,
E82109B026F1D83500FC3319 /* LoginBindPhonePresent.m in Sources */,
E865963F27015A9C00846EBD /* XPMineUserTableView.m in Sources */,
E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */,
E824544E26F5BC1A00BE8163 /* XPMineModifPayPwdView.m in Sources */,
E8B825CA26EA1231009E8E9F /* LoginVerifCodeViewController.m in Sources */,
@@ -1738,6 +1762,7 @@
186A534B26FC6ED900D67B2C /* TTPopupManagerService.m in Sources */,
18E7B1B226E8AF980064BC9B /* MainPresenter.m in Sources */,
E81366F626F0C0DF0076364C /* LoginFullInfoPresenter.m in Sources */,
E86596462701612D00846EBD /* UIImageView+Vague.m in Sources */,
189DD67E26E1FD8900AB55B1 /* UIImage+Utils.m in Sources */,
E824545626F5E51900BE8163 /* XPMineVerifIdentityViewController.m in Sources */,
186A534726FC6ED900D67B2C /* TTAlertConfig.m in Sources */,
@@ -1750,6 +1775,7 @@
E8B825CD26EA18C8009E8E9F /* ThemeColor.m in Sources */,
E8AC720D26F435F5007D6E91 /* UIImageView+LoadImage.m in Sources */,
E88B5CBD26FB3BDF00DA9178 /* XPTeenagerAlertView.m in Sources */,
E86596432701611A00846EBD /* UIImage+ImageEffects.m in Sources */,
E8CEA03D26EA3DE500644B44 /* LoginPasswordPresent.m in Sources */,
E8E70D7726F2F15100F03460 /* XPMineViewController.m in Sources */,
E8AC722C26F49580007D6E91 /* XPMineNotificaViewController.m in Sources */,

View File

@@ -18,7 +18,7 @@ UIKIT_EXTERN NSString * const kImageTypeRoomGift; //房间礼物
UIKIT_EXTERN NSString * const kImageTypeUserIcon; //用户头像60x60
UIKIT_EXTERN NSString * const kImageTypeUserLibaryDetail;//用户相册大图nil
UIKIT_EXTERN NSString * const kImageTypeCornerAvatar;//圆角图形会先把图形裁剪成正方形并且转换为png
UIKIT_EXTERN NSString * const kImageTypeUserInfoAlbum;//用户信息里面相册
typedef NS_ENUM(NSUInteger,ImageType){
ImageTypeRoomFace = 1, //房间表情
@@ -26,16 +26,17 @@ typedef NS_ENUM(NSUInteger,ImageType){
ImageTypeUserIcon, //用户头像60x60
ImageTypeUserLibaryDetail, //用户相册大图
ImageTypeCornerAvatar, //圆角图形会先把图形裁剪成正方形并且转换为png
ImageTypeUserInfoAlbum, ///用户信息里面相册
};
///展位图
/// 头像的默认占位图
+ (NSString *)defaultAvatarPlaceholder;
+ (UIImage *)defaultAvatarPlaceholder;
/// 空白图的占位图
+ (NSString *)defalutEmptyPlaceholder;
+ (UIImage *)defalutEmptyPlaceholder;
/// banner的占位图
+ (NSString *)defalutBannerPlaceholder;
+ (UIImage *)defalutBannerPlaceholder;
@end
NS_ASSUME_NONNULL_END

View File

@@ -15,18 +15,18 @@ NSString * const kImageTypeRoomGift = @"";
NSString * const kImageTypeUserIcon = @"imageMogr2/auto-orient/thumbnail/150x150"; //150x150
NSString * const kImageTypeUserLibaryDetail = @"imageMogr2/auto-orient/thumbnail/300x300"; //nil
NSString * const kImageTypeCornerAvatar = @"imageMogr2/auto-orient/thumbnail/300x300/format/png";
NSString * const kImageTypeUserInfoAlbum = @"imageMogr2/auto-orient/thumbnail/375x248"; ;//
///
+ (NSString *)defaultAvatarPlaceholder {
return @"common_avatar";
+ (UIImage *)defaultAvatarPlaceholder {
return [UIImage imageNamed:@"common_avatar"];
}
///
+ (NSString *)defalutEmptyPlaceholder {
return @"common_empty";
+ (UIImage *)defalutEmptyPlaceholder {
return [UIImage imageNamed:@"common_empty"];
}
/// banner
+ (NSString *)defalutBannerPlaceholder {
return @"common_banner";
+ (UIImage *)defalutBannerPlaceholder {
return [UIImage imageNamed:@"common_banner"];
}
@end

View File

@@ -16,19 +16,25 @@ NS_ASSUME_NONNULL_BEGIN
/// @param type 类型 用于设置大小
/// @param cornerRadious 弧度
/// @param success 成功的回调
- (void)load_setImageImageWithUrl:(NSString *)url
placeholderImage:(NSString *)placeholderImage
- (void)load_imageWithUrl:(NSString *)url
placeholderImage:(UIImage *)placeholderImage
type:(ImageType)type
cornerRadious:(CGFloat)cornerRadious
success:(void (^)(UIImage *image))success;
/// 加载图片 回调图片的
/// @param url 图片的链接地址
/// @param placeholderImage 站位图
/// @param success 成功了
- (void)load_imageWithUrl:(NSString *)url placeholderImage:(UIImage *)placeholderImage type:(ImageType)type success:(void (^)(UIImage *image))success;
/// 加载图片不需要成功的回调
/// @param url 图片的链接地址
/// @param placeholderImage 站位图
/// @param type 类型 用于设置大小
/// @param cornerRadious 弧度
- (void)load_setImageImageWithUrl:(NSString *)url
placeholderImage:(NSString *)placeholderImage
- (void)load_imageWithUrl:(NSString *)url
placeholderImage:(UIImage *)placeholderImage
type:(ImageType)type
cornerRadious:(CGFloat)cornerRadious;
@@ -36,18 +42,14 @@ NS_ASSUME_NONNULL_BEGIN
/// @param url 图片的链接地址
/// @param placeholderImage 站位图
/// @param type 类型 用于设置大小
- (void)load_setImageImageWithUrl:(NSString *)url placeholderImage:(NSString *)placeholderImage type:(ImageType)type;
- (void)load_imageWithUrl:(NSString *)url placeholderImage:(UIImage *)placeholderImage type:(ImageType)type;
/// 加载图片 没有类型的设置
/// @param url 图片的链接地址
/// @param placeholderImage 站位图
- (void)load_setImageImageWithUrl:(NSString *)url placeholderImage:(NSString *)placeholderImage;
- (void)load_imageWithUrl:(NSString *)url placeholderImage:(UIImage *)placeholderImage;
/// 加载图片 回调图片的
/// @param url 图片的链接地址
/// @param placeholderImage 站位图
/// @param success 成功了
- (void)load_setImageImageWithUrl:(NSString *)url placeholderImage:(NSString *)placeholderImage success:(void (^)(UIImage *image))success;
@end
NS_ASSUME_NONNULL_END

View File

@@ -17,8 +17,8 @@
/// @param type
/// @param cornerRadious
/// @param success
- (void)load_setImageImageWithUrl:(NSString *)url
placeholderImage:(NSString *)placeholderImage
- (void)load_imageWithUrl:(NSString *)url
placeholderImage:(UIImage *)placeholderImage
type:(ImageType)type
cornerRadious:(CGFloat)cornerRadious
success:(void (^)(UIImage *image))success {
@@ -50,6 +50,11 @@
configUrl = kImageTypeRoomGift;
}
break;
case ImageTypeUserInfoAlbum:
{
configUrl = kImageTypeUserInfoAlbum;
}
break;
default:
break;
}
@@ -69,8 +74,8 @@
NSString *encodeStr = [self URLEncodedString:urlString];
if (placeholderImage.length > 0) {
[self sd_setImageWithURL:[NSURL URLWithString:encodeStr] placeholderImage:[UIImage imageNamed:placeholderImage] options:SDWebImageRetryFailed completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
if (placeholderImage) {
[self sd_setImageWithURL:[NSURL URLWithString:encodeStr] placeholderImage:placeholderImage options:SDWebImageRetryFailed completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
if (success) {
success(image);
}
@@ -90,11 +95,11 @@
/// @param placeholderImage
/// @param type
/// @param cornerRadious
- (void)load_setImageImageWithUrl:(NSString *)url
placeholderImage:(NSString *)placeholderImage
- (void)load_imageWithUrl:(NSString *)url
placeholderImage:(UIImage *)placeholderImage
type:(ImageType)type
cornerRadious:(CGFloat)cornerRadious {
[self load_setImageImageWithUrl:url placeholderImage:placeholderImage type:type cornerRadious:cornerRadious success:nil];
[self load_imageWithUrl:url placeholderImage:placeholderImage type:type cornerRadious:cornerRadious success:nil];
}
@@ -102,15 +107,15 @@
/// @param url
/// @param placeholderImage
/// @param type
- (void)load_setImageImageWithUrl:(NSString *)url placeholderImage:(NSString *)placeholderImage type:(ImageType)type{
[self load_setImageImageWithUrl:url placeholderImage:placeholderImage type:type cornerRadious:0];
- (void)load_imageWithUrl:(NSString *)url placeholderImage:(UIImage *)placeholderImage type:(ImageType)type{
[self load_imageWithUrl:url placeholderImage:placeholderImage type:type cornerRadious:0];
}
///
/// @param url
/// @param placeholderImage
- (void)load_setImageImageWithUrl:(NSString *)url placeholderImage:(NSString *)placeholderImage {
[self load_setImageImageWithUrl:url placeholderImage:placeholderImage type:0 cornerRadious:0];
- (void)load_imageWithUrl:(NSString *)url placeholderImage:(UIImage *)placeholderImage {
[self load_imageWithUrl:url placeholderImage:placeholderImage type:0 cornerRadious:0];
}
@@ -118,10 +123,8 @@
/// @param url
/// @param placeholderImage
/// @param success
- (void)load_setImageImageWithUrl:(NSString *)url placeholderImage:(NSString *)placeholderImage success:(void (^)(UIImage *image))success{
[self sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:placeholderImage ? [UIImage imageNamed:placeholderImage] : nil completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
success(image);
}];
- (void)load_imageWithUrl:(NSString *)url placeholderImage:(UIImage *)placeholderImage type:(ImageType)type success:(void (^)(UIImage *image))success{
[self load_imageWithUrl:url placeholderImage:placeholderImage type:type cornerRadious:0 success:success];
}
- (NSString *)URLEncodedString:(NSString *)string

View File

@@ -0,0 +1,107 @@
/*
File: UIImage+ImageEffects.h
Abstract: This is a category of UIImage that adds methods to apply blur and tint effects to an image. This is the code youll want to look out to find out how to use vImage to efficiently calculate a blur.
Version: 1.0
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
this Apple software constitutes acceptance of these terms. If you do
not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2013 Apple Inc. All Rights Reserved.
Copyright © 2013 Apple Inc. All rights reserved.
WWDC 2013 License
NOTE: This Apple Software was supplied by Apple as part of a WWDC 2013
Session. Please refer to the applicable WWDC 2013 Session for further
information.
IMPORTANT: This Apple software is supplied to you by Apple Inc.
("Apple") in consideration of your agreement to the following terms, and
your use, installation, modification or redistribution of this Apple
software constitutes acceptance of these terms. If you do not agree with
these terms, please do not use, install, modify or redistribute this
Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a non-exclusive license, under
Apple's copyrights in this original Apple software (the "Apple
Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES
NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE
IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
EA1002
5/3/2013
*/
#import <UIKit/UIKit.h>
@interface UIImage (ImageEffects)
- (UIImage *)applyLightEffect;
- (UIImage *)applyExtraLightEffect;
- (UIImage *)applyDarkEffect;
- (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor;
- (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage;
@end

View File

@@ -0,0 +1,278 @@
/*
File: UIImage+ImageEffects.m
Abstract: This is a category of UIImage that adds methods to apply blur and tint effects to an image. This is the code youll want to look out to find out how to use vImage to efficiently calculate a blur.
Version: 1.0
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
this Apple software constitutes acceptance of these terms. If you do
not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2013 Apple Inc. All Rights Reserved.
Copyright © 2013 Apple Inc. All rights reserved.
WWDC 2013 License
NOTE: This Apple Software was supplied by Apple as part of a WWDC 2013
Session. Please refer to the applicable WWDC 2013 Session for further
information.
IMPORTANT: This Apple software is supplied to you by Apple Inc.
("Apple") in consideration of your agreement to the following terms, and
your use, installation, modification or redistribution of this Apple
software constitutes acceptance of these terms. If you do not agree with
these terms, please do not use, install, modify or redistribute this
Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a non-exclusive license, under
Apple's copyrights in this original Apple software (the "Apple
Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES
NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE
IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
EA1002
5/3/2013
*/
#import "UIImage+ImageEffects.h"
#import <Accelerate/Accelerate.h>
#import <float.h>
@implementation UIImage (ImageEffects)
- (UIImage *)applyLightEffect
{
UIColor *tintColor = [UIColor colorWithWhite:1.0 alpha:0.3];
return [self applyBlurWithRadius:30 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil];
}
- (UIImage *)applyExtraLightEffect
{
UIColor *tintColor = [UIColor colorWithWhite:0.97 alpha:0.82];
return [self applyBlurWithRadius:20 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil];
}
- (UIImage *)applyDarkEffect
{
UIColor *tintColor = [UIColor colorWithWhite:0.11 alpha:0.73];
return [self applyBlurWithRadius:20 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil];
}
- (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor
{
const CGFloat EffectColorAlpha = 0.6;
UIColor *effectColor = tintColor;
int componentCount = CGColorGetNumberOfComponents(tintColor.CGColor);
if (componentCount == 2) {
CGFloat b;
if ([tintColor getWhite:&b alpha:NULL]) {
effectColor = [UIColor colorWithWhite:b alpha:EffectColorAlpha];
}
}
else {
CGFloat r, g, b;
if ([tintColor getRed:&r green:&g blue:&b alpha:NULL]) {
effectColor = [UIColor colorWithRed:r green:g blue:b alpha:EffectColorAlpha];
}
}
return [self applyBlurWithRadius:10 tintColor:effectColor saturationDeltaFactor:-1.0 maskImage:nil];
}
- (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage
{
// Check pre-conditions.
if (self.size.width < 1 || self.size.height < 1) {
NSLog (@"*** error: invalid size: (%.2f x %.2f). Both dimensions must be >= 1: %@", self.size.width, self.size.height, self);
return nil;
}
if (!self.CGImage) {
NSLog (@"*** error: image must be backed by a CGImage: %@", self);
return nil;
}
if (maskImage && !maskImage.CGImage) {
NSLog (@"*** error: maskImage must be backed by a CGImage: %@", maskImage);
return nil;
}
CGRect imageRect = { CGPointZero, self.size };
UIImage *effectImage = self;
BOOL hasBlur = blurRadius > __FLT_EPSILON__;
BOOL hasSaturationChange = fabs(saturationDeltaFactor - 1.) > __FLT_EPSILON__;
if (hasBlur || hasSaturationChange) {
UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]);
CGContextRef effectInContext = UIGraphicsGetCurrentContext();
CGContextScaleCTM(effectInContext, 1.0, -1.0);
CGContextTranslateCTM(effectInContext, 0, -self.size.height);
CGContextDrawImage(effectInContext, imageRect, self.CGImage);
vImage_Buffer effectInBuffer;
effectInBuffer.data = CGBitmapContextGetData(effectInContext);
effectInBuffer.width = CGBitmapContextGetWidth(effectInContext);
effectInBuffer.height = CGBitmapContextGetHeight(effectInContext);
effectInBuffer.rowBytes = CGBitmapContextGetBytesPerRow(effectInContext);
UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]);
CGContextRef effectOutContext = UIGraphicsGetCurrentContext();
vImage_Buffer effectOutBuffer;
effectOutBuffer.data = CGBitmapContextGetData(effectOutContext);
effectOutBuffer.width = CGBitmapContextGetWidth(effectOutContext);
effectOutBuffer.height = CGBitmapContextGetHeight(effectOutContext);
effectOutBuffer.rowBytes = CGBitmapContextGetBytesPerRow(effectOutContext);
if (hasBlur) {
// A description of how to compute the box kernel width from the Gaussian
// radius (aka standard deviation) appears in the SVG spec:
// http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement
//
// For larger values of 's' (s >= 2.0), an approximation can be used: Three
// successive box-blurs build a piece-wise quadratic convolution kernel, which
// approximates the Gaussian kernel to within roughly 3%.
//
// let d = floor(s * 3*sqrt(2*pi)/4 + 0.5)
//
// ... if d is odd, use three box-blurs of size 'd', centered on the output pixel.
//
CGFloat inputRadius = blurRadius * [[UIScreen mainScreen] scale];
NSUInteger radius = floor(inputRadius * 3. * sqrt(2 * M_PI) / 4 + 0.5);
if (radius % 2 != 1) {
radius += 1; // force radius to be odd so that the three box-blur methodology works.
}
vImageBoxConvolve_ARGB8888(&effectInBuffer, &effectOutBuffer, NULL, 0, 0, radius, radius, 0, kvImageEdgeExtend);
vImageBoxConvolve_ARGB8888(&effectOutBuffer, &effectInBuffer, NULL, 0, 0, radius, radius, 0, kvImageEdgeExtend);
vImageBoxConvolve_ARGB8888(&effectInBuffer, &effectOutBuffer, NULL, 0, 0, radius, radius, 0, kvImageEdgeExtend);
}
BOOL effectImageBuffersAreSwapped = NO;
if (hasSaturationChange) {
CGFloat s = saturationDeltaFactor;
CGFloat floatingPointSaturationMatrix[] = {
0.0722 + 0.9278 * s, 0.0722 - 0.0722 * s, 0.0722 - 0.0722 * s, 0,
0.7152 - 0.7152 * s, 0.7152 + 0.2848 * s, 0.7152 - 0.7152 * s, 0,
0.2126 - 0.2126 * s, 0.2126 - 0.2126 * s, 0.2126 + 0.7873 * s, 0,
0, 0, 0, 1,
};
const int32_t divisor = 256;
NSUInteger matrixSize = sizeof(floatingPointSaturationMatrix)/sizeof(floatingPointSaturationMatrix[0]);
int16_t saturationMatrix[matrixSize];
for (NSUInteger i = 0; i < matrixSize; ++i) {
saturationMatrix[i] = (int16_t)roundf(floatingPointSaturationMatrix[i] * divisor);
}
if (hasBlur) {
vImageMatrixMultiply_ARGB8888(&effectOutBuffer, &effectInBuffer, saturationMatrix, divisor, NULL, NULL, kvImageNoFlags);
effectImageBuffersAreSwapped = YES;
}
else {
vImageMatrixMultiply_ARGB8888(&effectInBuffer, &effectOutBuffer, saturationMatrix, divisor, NULL, NULL, kvImageNoFlags);
}
}
if (!effectImageBuffersAreSwapped)
effectImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
if (effectImageBuffersAreSwapped)
effectImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
// Set up output context.
UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]);
CGContextRef outputContext = UIGraphicsGetCurrentContext();
CGContextScaleCTM(outputContext, 1.0, -1.0);
CGContextTranslateCTM(outputContext, 0, -self.size.height);
// Draw base image.
CGContextDrawImage(outputContext, imageRect, self.CGImage);
// Draw effect image.
if (hasBlur) {
CGContextSaveGState(outputContext);
if (maskImage) {
CGContextClipToMask(outputContext, imageRect, maskImage.CGImage);
}
CGContextDrawImage(outputContext, imageRect, effectImage.CGImage);
CGContextRestoreGState(outputContext);
}
// Add in color tint.
if (tintColor) {
CGContextSaveGState(outputContext);
CGContextSetFillColorWithColor(outputContext, tintColor.CGColor);
CGContextFillRect(outputContext, imageRect);
CGContextRestoreGState(outputContext);
}
// Output image is ready.
UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return outputImage;
}
@end

View File

@@ -0,0 +1,20 @@
//
// UIImageView+Vague.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/27.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UIImageView (Vague)
/// 模糊的效果
/// @param image 需要模糊的图片
/// @param blurRadius 角度 越大 模糊的越不明显 默认20
- (void)setImageToBlur:(UIImage *)image
blurRadius:(CGFloat)blurRadius;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,34 @@
//
// UIImageView+Vague.m
// xplan-ios
//
// Created by on 2021/9/27.
//
#import "UIImageView+Vague.h"
#import "UIImage+ImageEffects.h"
@implementation UIImageView (Vague)
///
/// @param image
/// @param blurRadius 20
- (void)setImageToBlur:(UIImage *)image
blurRadius:(CGFloat)blurRadius {
NSParameterAssert(image);
if (blurRadius < 0) {
blurRadius = 20;
}
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
UIImage *blurredImage = [image applyBlurWithRadius:blurRadius
tintColor:nil
saturationDeltaFactor:1.8
maskImage:nil];
dispatch_async(dispatch_get_main_queue(), ^{
self.image = blurredImage;
});
});
}
@end

View File

@@ -58,7 +58,7 @@
- (void)setPhoto:(UserPhoto *)photo {
_photo = photo;
if (_photo) {
[self.logoImageView load_setImageImageWithUrl:_photo.photoUrl placeholderImage:[UIImageConstant defaultAvatarPlaceholder] type:ImageTypeUserLibaryDetail];
[self.logoImageView load_imageWithUrl:_photo.photoUrl placeholderImage:[UIImageConstant defaultAvatarPlaceholder] type:ImageTypeUserLibaryDetail];
}
}

View File

@@ -113,7 +113,7 @@
for (int i = 0; i < array.count; i++) {
UIImageView * imageView = [self.photoViewArray objectAtIndex:i];
NSString * imageUrl = [array objectAtIndex:i].photoUrl;
[imageView load_setImageImageWithUrl:imageUrl placeholderImage:[UIImageConstant defaultAvatarPlaceholder] type:ImageTypeUserIcon];
[imageView load_imageWithUrl:imageUrl placeholderImage:[UIImageConstant defaultAvatarPlaceholder] type:ImageTypeUserIcon];
}
}
@@ -125,7 +125,7 @@
self.phototStackView.hidden = YES;
self.avatarImageView.hidden = NO;
if (model.avatarUrl.length > 0) {
[self.avatarImageView load_setImageImageWithUrl:model.avatarUrl placeholderImage:[UIImageConstant defaultAvatarPlaceholder] type:ImageTypeUserIcon];
[self.avatarImageView load_imageWithUrl:model.avatarUrl placeholderImage:[UIImageConstant defaultAvatarPlaceholder] type:ImageTypeUserIcon];
}
}
break;

View File

@@ -194,7 +194,7 @@
#pragma mark - SDPhotoBrowserDelegate
- (UIImage *)photoBrowser:(SDPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index {
return [UIImage imageNamed:[UIImageConstant defaultAvatarPlaceholder]];
return [UIImageConstant defaultAvatarPlaceholder];
}
- (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index {

View File

@@ -11,7 +11,9 @@ NS_ASSUME_NONNULL_BEGIN
@interface XPMineUserInfoViewController : MvpViewController
///用户的id
@property (nonatomic,assign) long long uid;
@property (nonatomic,assign) NSInteger uid;
- (UIView *)getHeadHitView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -8,6 +8,7 @@
#import "XPMineUserInfoViewController.h"
///Third
#import <Masonry/Masonry.h>
#import <SDCycleScrollView/SDCycleScrollView.h>
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
@@ -15,6 +16,7 @@
#import "XPMineUserInfoTableViewCell.h"
#import "XPMineUserInfoHeaderView.h"
#import "XPMineUserInfoCustomNavView.h"
#import "XPMineUserTableView.h"
///P
#import "XPMineUserInfoPresenter.h"
#import "XPMineUserInfoProtocol.h"
@@ -23,7 +25,7 @@
@interface XPMineUserInfoViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, UIGestureRecognizerDelegate>
///
@property (nonatomic,strong) UITableView *tableView;
@property (nonatomic,strong) XPMineUserTableView *tableView;
///
@property (nonatomic,strong) XPMineUserInfoHeaderView *headView;
///table
@@ -58,6 +60,11 @@
}
}
#pragma mark - Public Method
- (UIView *)getHeadHitView {
return self.headView.cycleScrollView;
}
#pragma mark - Private Method
- (void)initSubViews {
[self.view addSubview:self.headView];
@@ -65,6 +72,7 @@
[self.view addSubview:self.navView];
#warning to do
self.tableView.tableHeaderView = self.tableViewHeadView;
self.tableView.userInfoVC = self;
}
- (void)initSubViewConstraints {
@@ -123,17 +131,17 @@
}
#pragma mark - Getters And Setters
- (void)setUid:(long long)uid {
- (void)setUid:(NSInteger)uid {
_uid = uid;
if (_uid > 0) {
NSString * uidStr = [NSString stringWithFormat:@"%lld", uid];
NSString * uidStr = [NSString stringWithFormat:@"%d", uid];
[self.presenter getUserInfoWithUid:uidStr];
}
}
- (UITableView *)tableView {
- (XPMineUserTableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_tableView = [[XPMineUserTableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.tableFooterView = [UIView new];

View File

@@ -8,10 +8,12 @@
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class UserInfoModel;
@class UserInfoModel, SDCycleScrollView;
@interface XPMineUserInfoHeaderView : UIView
///
@property (nonatomic,strong) UserInfoModel *userInfo;
///轮播图
@property (nonatomic,strong, readonly) SDCycleScrollView *cycleScrollView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -14,17 +14,58 @@
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
#import "UIImageConstant.h"
#import "UIImageView+LoadImage.h"
#import "UIImageView+Vague.h"
///Model
#import "UserInfoModel.h"
@interface XPMineUserInfoImageCollectionViewCell : UICollectionViewCell
///
@property (nonatomic,strong) UIImageView *logoImageView;
@end
@implementation XPMineUserInfoImageCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self.contentView addSubview:self.logoImageView];
}
- (void)initSubViewConstraints {
[self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
}
#pragma mark - Getters And Setters
- (UIImageView *)logoImageView {
if (!_logoImageView) {
_logoImageView = [[UIImageView alloc] init];
_logoImageView.userInteractionEnabled = YES;
_logoImageView.layer.masksToBounds = YES;
_logoImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _logoImageView;
}
@end
@interface XPMineUserInfoHeaderView ()<SDCycleScrollViewDelegate, SDPhotoBrowserDelegate>
///
@property (nonatomic,strong) UIView * coverView;
///
@property (nonatomic,strong) SDCycleScrollView *cycleScrollView;
///
@property (nonatomic,strong) UIVisualEffectView *effectView;
///
@property (nonatomic,strong) UILabel *pageLabel;
///
@@ -44,7 +85,6 @@
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.cycleScrollView];
[self addSubview:self.effectView];
[self addSubview:self.coverView];
[self addSubview:self.pageLabel];
}
@@ -54,10 +94,6 @@
make.edges.mas_equalTo(self);
}];
[self.effectView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);
}];
[self.coverView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.cycleScrollView);
}];
@@ -76,12 +112,29 @@
}
- (UIImage *)photoBrowser:(SDPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index {
return [UIImage imageNamed:[UIImageConstant defalutBannerPlaceholder]];
return [UIImageConstant defalutBannerPlaceholder];
}
#pragma mark - SDCycleScrollViewDelegate
/** cellcellclass */
- (Class)customCollectionViewCellClassForCycleScrollView:(SDCycleScrollView *)view {
return [XPMineUserInfoImageCollectionViewCell class];
}
- (void)setupCustomCell:(UICollectionViewCell *)cell forIndex:(NSInteger)index cycleScrollView:(SDCycleScrollView *)view {
XPMineUserInfoImageCollectionViewCell * imageCell = (XPMineUserInfoImageCollectionViewCell *)cell;
NSString *url = [self.imageUrls objectAtIndex:index];
@weakify(imageCell);
[imageCell.logoImageView load_imageWithUrl:url placeholderImage:[UIImageConstant defalutBannerPlaceholder] type:ImageTypeUserInfoAlbum success:^(UIImage * _Nonnull image) {
@strongify(imageCell);
if (image) {
[imageCell.logoImageView setImageToBlur:image blurRadius:45];
}
}];
}
-(void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didScrollToIndex:(NSInteger)index {
self.pageLabel.text = [NSString stringWithFormat:@"%ld/%lu",(index + 1), (unsigned long)self.imageUrls.count];
self.pageLabel.text = [NSString stringWithFormat:@"%d/%lu",(index + 1), (unsigned long)self.imageUrls.count];
}
//
@@ -124,7 +177,7 @@
if (!_coverView) {
_coverView = [[UIView alloc] init];
_coverView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:1];
_coverView.alpha = 0.5;
_coverView.alpha = 0.2;
}
return _coverView;
}
@@ -136,21 +189,12 @@
_cycleScrollView.delegate = self;
_cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
_cycleScrollView.pageControlStyle = SDCycleScrollViewPageContolStyleNone;;
_cycleScrollView.placeholderImage = [UIImage imageNamed:[UIImageConstant defaultAvatarPlaceholder]];
_cycleScrollView.placeholderImage = [UIImageConstant defaultAvatarPlaceholder];
_cycleScrollView.autoScroll = NO;
}
return _cycleScrollView;
}
- (UIVisualEffectView *)effectView {
if (!_effectView) {
UIBlurEffect *beffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *view = [[UIVisualEffectView alloc]initWithEffect:beffect];
_effectView = view;
}
return _effectView;
}
- (UILabel *)pageLabel {
if (!_pageLabel) {
_pageLabel = [[UILabel alloc] init];

View File

@@ -0,0 +1,16 @@
//
// XPMineUserTableView.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/27.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPMineUserTableView : UITableView
///
@property (nonatomic,weak) UIViewController *userInfoVC;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,22 @@
//
// XPMineUserTableView.m
// xplan-ios
//
// Created by on 2021/9/27.
//
#import "XPMineUserTableView.h"
#import "XPMacro.h"
#import "XPMineUserInfoViewController.h"
@implementation XPMineUserTableView
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
if (point.y > (250 + kSafeAreaTopHeight)) {
return self;
} else {
return [[(XPMineUserInfoViewController *)self.userInfoVC getHeadHitView] hitTest:point withEvent:event];
}
}
@end

View File

@@ -129,7 +129,7 @@
if (_userInfo) {
self.idLabel.text = [NSString stringWithFormat:@"音游号:%ld", (long)_userInfo.erbanNo];
self.nameLabel.text = _userInfo.nick.length > 0 ? _userInfo.nick : @"";
[self.avatarImageView load_setImageImageWithUrl:_userInfo.avatar placeholderImage:[UIImageConstant defaultAvatarPlaceholder]];
[self.avatarImageView load_imageWithUrl:_userInfo.avatar placeholderImage:[UIImageConstant defaultAvatarPlaceholder] type:ImageTypeUserIcon];
NSString * sexName;
if (userInfo.gender == GenderType_Male) {
sexName = @"common_male";