系统弹层不好看?那就自己封装一个弹层小控件吧~
新建一个类,继承自UIView,(类名MessagePopView)
头文件中的代码:
#import <UIKit/UIKit.h>
@interface MessagePopView : UIView
-(void) hidePopView;
-(void) showPopView;
@end
.m文件实现:
#import "MessagePopView.h"
#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
@interface MessagePopView ()
@property (strong, nonatomic)UIImageView *imgView;
@property (strong, nonatomic)UIImageView *imgViewMessage;
@property (strong, nonatomic)UILabel *backgroundLabel;
@property (strong, nonatomic)UIView *contentView;
@property (nonatomic, strong)UIButton *clearMessageBtn;
@property (nonatomic, strong)UIButton *cancelBtn;
@end
@implementation