This commit is contained in:
lianxiang
2018-09-27 00:20:01 +08:00
parent d0230f55ed
commit cb0accdb66
60 changed files with 1063 additions and 290 deletions
@@ -16,7 +16,10 @@
}
-(void)comfirmTitles:(NSIndexPath *)indepath
{
NSArray *titles = @[@"手机相册",@"系统相册",@"自拍"];
NSArray *titles = @[@"手机相册",@"系统相册",@"自拍",@"取消"];
if (indepath.row == 3) {
self.sheetTitle.textColor = GIGARGB(165,165, 165, 1);
}
self.sheetTitle.text = titles[indepath.row];
}
@@ -14,5 +14,6 @@
@property (weak, nonatomic) IBOutlet UILabel *timeLabe;
@property (weak, nonatomic) IBOutlet UILabel *percetLabe;
@property (weak, nonatomic) IBOutlet UILabel *totalLabe;
@property (weak, nonatomic) IBOutlet UIImageView *userAvtoar;
@end
@@ -20,6 +20,9 @@
self.timeBackVIew.layer.shadowOffset = CGSizeMake(2,1);
self.timeBackVIew.layer.shadowColor = GIGARGB(91, 91, 91, 0.6).CGColor;
self.timeBackVIew.layer.shadowOpacity = 0.8;
self.userAvtoar.layer.masksToBounds = YES;
self.userAvtoar.layer.cornerRadius = 4;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
@@ -178,6 +178,7 @@
<outlet property="timeBackVIew" destination="H7C-wU-YeM" id="q2o-NG-UKS"/>
<outlet property="timeLabe" destination="znk-jF-QRT" id="pii-LG-rfu"/>
<outlet property="totalLabe" destination="ZJ1-li-JLb" id="MeX-lM-Wfv"/>
<outlet property="userAvtoar" destination="ocM-SZ-rcr" id="buS-pJ-uPg"/>
<outlet property="userIcon" destination="ocM-SZ-rcr" id="VxR-wi-5fs"/>
</connections>
<point key="canvasLocation" x="34" y="53.5"/>
@@ -7,9 +7,13 @@
//
#import <UIKit/UIKit.h>
typedef void (^actionSheetAction)(NSUInteger index);
@interface MaskTimeShareActionSheet : UIView
@interface MaskTimeShareActionSheet : UIViewController
@property(nonatomic,copy) actionSheetAction action;
-(void)show:(actionSheetAction)action;
+(MaskTimeShareActionSheet *)showAtView:(UIViewController *)vc;
@end
@@ -15,58 +15,55 @@
@implementation MaskTimeShareActionSheet
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3]; ;
[self creatUI];
}
return self;
- (void)viewDidLoad{
[super viewDidLoad];
self.view.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.4];
[self creatUI];
}
-(void)creatUI{
UIView *holdview =[[UIView alloc] init];
holdview.frame =CGRectMake(0,KMainH - 216 - 60 -20 , KMainW, 216 + 60 +20);
holdview.backgroundColor = [UIColor whiteColor];
// CGRect backRect= holdview.frame;
//
holdview.frame =CGRectMake(0,KMainH - 216 , KMainW, 216);
holdview.backgroundColor = [UIColor whiteColor];
//CGRect backRect= holdview.frame;
// UIBezierPath *maskPath=[UIBezierPath bezierPathWithRoundedRect:backRect byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(15, 15)];
// CAShapeLayer *maskLayer =[[CAShapeLayer alloc] init];
// maskLayer.frame = backRect;
// maskLayer.path = maskPath.CGPath;
// holdview.layer.mask = maskLayer;
holdview.layer.masksToBounds = YES;
holdview.layer.cornerRadius = 10;
[self addSubview:holdview];
// holdview.layer.masksToBounds = YES;
// holdview.layer.cornerRadius = 10;
[self.view addSubview:holdview];
self.tabview = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KMainW, 216 + 60) style:UITableViewStylePlain];
self.tabview = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KMainW, 216) style:UITableViewStylePlain];
self.tabview.backgroundColor = [UIColor whiteColor];
self.tabview.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tabview.delegate = self;
self.tabview.scrollEnabled = NO;
self.tabview.dataSource = self;
UIButton *cancleBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[cancleBtn setTitle:@"取消" forState:UIControlStateNormal];
[cancleBtn setTitleColor:GIGARGB(165,165, 165, 1) forState:UIControlStateNormal];
[cancleBtn addTarget:self action:@selector(cancelAction) forControlEvents:UIControlEventTouchUpInside];
cancleBtn.frame = CGRectMake(0,1, KMainW,60);
self.tabview.tableFooterView = cancleBtn;
[holdview addSubview:self.tabview];
}
+(MaskTimeShareActionSheet *)showAtView:(UIViewController *)vc{
MaskTimeShareActionSheet *Sheet = [[MaskTimeShareActionSheet alloc] init];
if (ISIOS8) {
Sheet.modalPresentationStyle = UIModalPresentationOverCurrentContext;
}else{
Sheet.modalPresentationStyle = UIModalPresentationCurrentContext;
}
[vc presentViewController:Sheet animated:YES completion:nil];
return Sheet;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 3;
return 4;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
@@ -82,11 +79,16 @@
return 54;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (self.action) {
self.action(indexPath.row);
if (indexPath.row == 3) {
[self cancleDissmiss];
}else{
[self cancleDissmiss];
if (self.action) {
self.action(indexPath.row);
}
}
}
-(void)show:(actionSheetAction)action{
@@ -106,10 +108,8 @@
}
-(void)cancleDissmiss{
[UIView animateWithDuration:1.0 animations:^{
self.tabview.frame = CGRectMake(0, KMainH - 216, KMainW, 0);
}];
[self removeFromSuperview];
[self dismissViewControllerAnimated:NO completion:nil];
}
@@ -9,5 +9,7 @@
#import <UIKit/UIKit.h>
@interface MaskTimeShareViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *doinglabel;
@property (weak, nonatomic) IBOutlet UIImageView *shareLabe;
@end
@@ -41,7 +41,7 @@
<constraint firstAttribute="height" constant="35" id="zzS-Dk-zsi"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="share_one" translatesAutoresizingMaskIntoConstraints="NO" id="dlk-Er-Voj">
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="share_oneblack" translatesAutoresizingMaskIntoConstraints="NO" id="dlk-Er-Voj">
<rect key="frame" x="42" y="229" width="162" height="19"/>
<constraints>
<constraint firstAttribute="height" constant="19" id="JLN-Jh-Gue"/>
@@ -63,12 +63,16 @@
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="doinglabel" destination="ajv-9T-Bcf" id="Le0-Q8-0zg"/>
<outlet property="shareLabe" destination="dlk-Er-Voj" id="iWt-Wf-6y7"/>
</connections>
<point key="canvasLocation" x="34" y="53.5"/>
</tableViewCell>
</objects>
<resources>
<image name="share_logo" width="185" height="85"/>
<image name="share_one" width="133" height="17"/>
<image name="share_oneblack" width="133" height="17"/>
<image name="share_two" width="155" height="35"/>
</resources>
</document>