diff --git a/ManagerDemo.xcodeproj/project.pbxproj b/ManagerDemo.xcodeproj/project.pbxproj index 63c3a80..4688cd8 100644 --- a/ManagerDemo.xcodeproj/project.pbxproj +++ b/ManagerDemo.xcodeproj/project.pbxproj @@ -20,6 +20,9 @@ A93F8804199A077F00875287 /* LoanListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A93F87FB199A077F00875287 /* LoanListCell.xib */; }; A93F8805199A077F00875287 /* LoanListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A93F87FD199A077F00875287 /* LoanListViewController.m */; }; A93F8806199A077F00875287 /* OtherListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A93F87FF199A077F00875287 /* OtherListViewController.m */; }; + A988A8FC199A50D900EB10AA /* TriangleView.m in Sources */ = {isa = PBXBuildFile; fileRef = A988A8FB199A50D900EB10AA /* TriangleView.m */; }; + A988A900199A751500EB10AA /* FundListCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A988A8FF199A751500EB10AA /* FundListCell.m */; }; + A988A902199A755300EB10AA /* FundListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A988A901199A755300EB10AA /* FundListCell.xib */; }; A9AA325A199702DB000BE4FB /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A9AA3259199702DB000BE4FB /* Images.xcassets */; }; A9AA326019970335000BE4FB /* HomeAdView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9AA325D19970335000BE4FB /* HomeAdView.m */; }; A9AA326119970335000BE4FB /* ImagePlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9AA325F19970335000BE4FB /* ImagePlayerView.m */; }; @@ -128,6 +131,11 @@ A93F87FD199A077F00875287 /* LoanListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoanListViewController.m; sourceTree = ""; }; A93F87FE199A077F00875287 /* OtherListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OtherListViewController.h; sourceTree = ""; }; A93F87FF199A077F00875287 /* OtherListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OtherListViewController.m; sourceTree = ""; }; + A988A8FA199A50D900EB10AA /* TriangleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriangleView.h; sourceTree = ""; }; + A988A8FB199A50D900EB10AA /* TriangleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TriangleView.m; sourceTree = ""; }; + A988A8FE199A751500EB10AA /* FundListCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FundListCell.h; sourceTree = ""; }; + A988A8FF199A751500EB10AA /* FundListCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FundListCell.m; sourceTree = ""; }; + A988A901199A755300EB10AA /* FundListCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FundListCell.xib; sourceTree = ""; }; A9AA3259199702DB000BE4FB /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; A9AA325C19970335000BE4FB /* HomeAdView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeAdView.h; sourceTree = ""; }; A9AA325D19970335000BE4FB /* HomeAdView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeAdView.m; sourceTree = ""; }; @@ -279,6 +287,15 @@ path = AttributedString; sourceTree = ""; }; + A988A8F9199A50B600EB10AA /* UIViewShape */ = { + isa = PBXGroup; + children = ( + A988A8FA199A50D900EB10AA /* TriangleView.h */, + A988A8FB199A50D900EB10AA /* TriangleView.m */, + ); + path = UIViewShape; + sourceTree = ""; + }; A9A660B31999180000E9D166 /* ListView */ = { isa = PBXGroup; children = ( @@ -294,6 +311,9 @@ A93F87FD199A077F00875287 /* LoanListViewController.m */, A93F87FE199A077F00875287 /* OtherListViewController.h */, A93F87FF199A077F00875287 /* OtherListViewController.m */, + A988A8FE199A751500EB10AA /* FundListCell.h */, + A988A8FF199A751500EB10AA /* FundListCell.m */, + A988A901199A755300EB10AA /* FundListCell.xib */, ); path = ListView; sourceTree = ""; @@ -416,6 +436,7 @@ A9AF6C4A19949B510076C0EE /* Common */ = { isa = PBXGroup; children = ( + A988A8F9199A50B600EB10AA /* UIViewShape */, A93F87C71999E4DA00875287 /* AttributedString */, A93F877D1999B91600875287 /* SlideSwitch */, A93F87751999AB4400875287 /* MBProgressHUD */, @@ -597,6 +618,7 @@ A93F8804199A077F00875287 /* LoanListCell.xib in Resources */, A9AF6C731994B5890076C0EE /* icon_bar_share@2x.png in Resources */, A9EAA04019985EDE001A872A /* HomeMainView.xib in Resources */, + A988A902199A755300EB10AA /* FundListCell.xib in Resources */, A9AF6C6919949CD30076C0EE /* icon_dock_session@2x.png in Resources */, A9AF6C5C19949CD30076C0EE /* icon_dock_forum_actived@2x.png in Resources */, A9AF6CA61994D0660076C0EE /* ad4@2x.png in Resources */, @@ -692,12 +714,14 @@ buildActionMask = 2147483647; files = ( A93F8801199A077F00875287 /* ListViewController.m in Sources */, + A988A8FC199A50D900EB10AA /* TriangleView.m in Sources */, A9EAA05619988C55001A872A /* MRCircularProgressView.m in Sources */, A9AF6C961994C5700076C0EE /* UIView+Extension.m in Sources */, A9AF6C921994C5700076C0EE /* MJRefreshFooterView.m in Sources */, A93F87CA1999E62000875287 /* AdjustableUILable.m in Sources */, A93F8803199A077F00875287 /* LoanListCell.m in Sources */, A9AA326019970335000BE4FB /* HomeAdView.m in Sources */, + A988A900199A751500EB10AA /* FundListCell.m in Sources */, A9AF6C3D199486CA0076C0EE /* ProductListViewController.m in Sources */, A93F87741999AA8300875287 /* ManagerUtil.m in Sources */, A9AF6C941994C5700076C0EE /* UIScrollView+Extension.m in Sources */, diff --git a/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate b/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate index a8bed22..0f1a8c7 100644 Binary files a/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate and b/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ManagerDemo/Common/MRCircularProgressView/MRCircularProgressView.m b/ManagerDemo/Common/MRCircularProgressView/MRCircularProgressView.m index e51a023..3e22929 100755 --- a/ManagerDemo/Common/MRCircularProgressView/MRCircularProgressView.m +++ b/ManagerDemo/Common/MRCircularProgressView/MRCircularProgressView.m @@ -59,8 +59,14 @@ self.currentProgress = 0.0f; self.lastProgress = 0.0f; self.animated = YES; - self.progressColor = [UIColor blueColor]; - self.wrapperColor = self.progressColor; + + if (self.progressColor == nil) { + self.progressColor = [UIColor blueColor]; + } + if (self.wrapperColor == nil) { + self.wrapperColor = self.progressColor; + } + self.duration = 0.5; self.progressArcWidth = 3.0f; self.wrapperArcWidth = 1.f; diff --git a/ManagerDemo/Common/SlideSwitch/QCSlideSwitchView.h b/ManagerDemo/Common/SlideSwitch/QCSlideSwitchView.h index 463b110..af00a78 100644 --- a/ManagerDemo/Common/SlideSwitch/QCSlideSwitchView.h +++ b/ManagerDemo/Common/SlideSwitch/QCSlideSwitchView.h @@ -121,5 +121,13 @@ */ - (void)slideSwitchView:(QCSlideSwitchView *)view didselectTab:(NSUInteger)number; +/*! + * @method 滑动tab + * @abstract + * @discussion + * @param tab索引 + * @result + */ +- (void)slideSwitchView:(QCSlideSwitchView *)view didScrollTab:(NSUInteger)number; @end diff --git a/ManagerDemo/Common/SlideSwitch/QCSlideSwitchView.m b/ManagerDemo/Common/SlideSwitch/QCSlideSwitchView.m index b1601d0..9b2bdf7 100644 --- a/ManagerDemo/Common/SlideSwitch/QCSlideSwitchView.m +++ b/ManagerDemo/Common/SlideSwitch/QCSlideSwitchView.m @@ -132,7 +132,6 @@ static const NSUInteger kTagOfRightSideButton = 999; UIViewController *vc = [self.slideSwitchViewDelegate slideSwitchView:self viewOfTab:i]; [_viewArray addObject:vc]; [_rootScrollView addSubview:vc.view]; - NSLog(@"%@",[vc.view class]); } [self createNameButtons]; @@ -312,6 +311,10 @@ static const NSUInteger kTagOfRightSideButton = 999; int tag = (int)scrollView.contentOffset.x/self.bounds.size.width +100; UIButton *button = (UIButton *)[_topScrollView viewWithTag:tag]; [self selectNameButton:button]; + if (self.slideSwitchViewDelegate + && [self.slideSwitchViewDelegate respondsToSelector:@selector(slideSwitchView:didScrollTab:)]) { + [self.slideSwitchViewDelegate slideSwitchView:self didScrollTab:tag-100]; + } } } diff --git a/ManagerDemo/Common/UIViewShape/TriangleView.h b/ManagerDemo/Common/UIViewShape/TriangleView.h new file mode 100644 index 0000000..dcadf7d --- /dev/null +++ b/ManagerDemo/Common/UIViewShape/TriangleView.h @@ -0,0 +1,13 @@ +// +// TriangleView.h +// ManagerDemo +// +// Created by xmfish on 14-8-12. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#import + +@interface TriangleView : UIView + +@end diff --git a/ManagerDemo/Common/UIViewShape/TriangleView.m b/ManagerDemo/Common/UIViewShape/TriangleView.m new file mode 100644 index 0000000..e133e2c --- /dev/null +++ b/ManagerDemo/Common/UIViewShape/TriangleView.m @@ -0,0 +1,62 @@ +// +// TriangleView.m +// ManagerDemo +// +// Created by xmfish on 14-8-12. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#import "TriangleView.h" + +@implementation TriangleView + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + } + return self; +} + + +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- +(void)drawRect:(CGRect)rect + +{ + + //设置背景颜色 + + [[UIColor whiteColor]set]; + + UIRectFill([self bounds]); + + //拿到当前视图准备好的画板 + + CGContextRef + context = UIGraphicsGetCurrentContext(); + + //利用path进行绘制三角形 + + CGContextBeginPath(context);//标记 + + CGContextMoveToPoint(context,0, 0);//设置起点 + + CGContextAddLineToPoint(context,165, 0); + + CGContextAddLineToPoint(context,165, 105); + + CGContextClosePath(context);//路径结束标志,不写默认封闭 + + [[UIColor redColor] setFill]; //设置填充色 + + [[UIColor blueColor] setStroke]; //设置边框颜色 + + CGContextDrawPath(context,kCGPathFillStroke);//绘制路径path + +} + + +@end diff --git a/ManagerDemo/MainView/ListView/FundListCell.h b/ManagerDemo/MainView/ListView/FundListCell.h new file mode 100644 index 0000000..ea653b4 --- /dev/null +++ b/ManagerDemo/MainView/ListView/FundListCell.h @@ -0,0 +1,13 @@ +// +// FundListCell.h +// ManagerDemo +// +// Created by xmfish on 14-8-13. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#import + +@interface FundListCell : UITableViewCell + +@end diff --git a/ManagerDemo/MainView/ListView/FundListCell.m b/ManagerDemo/MainView/ListView/FundListCell.m new file mode 100644 index 0000000..f9c7a73 --- /dev/null +++ b/ManagerDemo/MainView/ListView/FundListCell.m @@ -0,0 +1,29 @@ +// +// FundListCell.m +// ManagerDemo +// +// Created by xmfish on 14-8-13. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#import "FundListCell.h" + +@implementation FundListCell + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + // Initialization code + } + return self; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/ManagerDemo/MainView/ListView/FundListCell.xib b/ManagerDemo/MainView/ListView/FundListCell.xib new file mode 100644 index 0000000..96970b9 --- /dev/null +++ b/ManagerDemo/MainView/ListView/FundListCell.xib @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ManagerDemo/MainView/ListView/FundListViewController.m b/ManagerDemo/MainView/ListView/FundListViewController.m index 4632a9c..a5a912d 100644 --- a/ManagerDemo/MainView/ListView/FundListViewController.m +++ b/ManagerDemo/MainView/ListView/FundListViewController.m @@ -7,7 +7,7 @@ // #import "FundListViewController.h" - +#import "TriangleView.h" @interface FundListViewController () @end @@ -27,6 +27,8 @@ { [super viewDidLoad]; // Do any additional setup after loading the view. + TriangleView* view = [[TriangleView alloc] initWithFrame:CGRectMake(20, 100, 200, 200)]; + [self.view addSubview:view]; } - (void)didReceiveMemoryWarning diff --git a/ManagerDemo/MainView/ListView/ListViewController.xib b/ManagerDemo/MainView/ListView/ListViewController.xib index b4d8288..293a411 100644 --- a/ManagerDemo/MainView/ListView/ListViewController.xib +++ b/ManagerDemo/MainView/ListView/ListViewController.xib @@ -15,7 +15,7 @@ - + diff --git a/ManagerDemo/MainView/ListView/LoanListCell.h b/ManagerDemo/MainView/ListView/LoanListCell.h index af0b8df..d264e1d 100644 --- a/ManagerDemo/MainView/ListView/LoanListCell.h +++ b/ManagerDemo/MainView/ListView/LoanListCell.h @@ -7,7 +7,18 @@ // #import +#import "MRCircularProgressView.h" @interface LoanListCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UILabel *nameLabel; +@property (weak, nonatomic) IBOutlet UILabel *infoLabel; +@property (weak, nonatomic) IBOutlet UILabel *profitLabel; +@property (weak, nonatomic) IBOutlet UIImageView *typeImg; +@property (weak, nonatomic) IBOutlet UILabel *priceLabel; +@property (weak, nonatomic) IBOutlet DTAttributedLabel *timeDtLabel; +@property (weak, nonatomic) IBOutlet DTAttributedLabel *percentDtlabel; +@property (weak, nonatomic) IBOutlet MRCircularProgressView *percentView; +-(void)setPercent:(NSInteger) percent; +-(void)setTimeWithString:(NSString*)htmlString; @end diff --git a/ManagerDemo/MainView/ListView/LoanListCell.m b/ManagerDemo/MainView/ListView/LoanListCell.m index 106a77b..83e677e 100644 --- a/ManagerDemo/MainView/ListView/LoanListCell.m +++ b/ManagerDemo/MainView/ListView/LoanListCell.m @@ -15,6 +15,7 @@ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { // Initialization code + } return self; } @@ -26,4 +27,34 @@ // Configure the view for the selected state } +-(void)awakeFromNib +{ +// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*1.0), +// dispatch_get_main_queue(), ^(){ +// [self initView]; +// }); + [self initView]; +} +-(void)initView +{ + _percentView.wrapperColor = [UIColor clearColor]; + _percentView.progressColor = [UIColor redColor]; + _percentDtlabel.backgroundColor = [UIColor clearColor]; +} +-(void)setPercent:(NSInteger) percent +{ + NSString* htmlStr = [NSString stringWithFormat:@"%ld %%",percent]; + NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding]; + NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentCenter],DTDefaultTextAlignment, nil]; + NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil]; + _percentDtlabel.attributedString = percentString; + [_percentView setProgress:percent/100.0 animated:NO]; +} +-(void)setTimeWithString:(NSString*)htmlString +{ + NSData *data = [htmlString dataUsingEncoding:NSUTF8StringEncoding]; + NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentCenter],DTDefaultTextAlignment, nil]; + NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil]; + _timeDtLabel.attributedString = percentString; +} @end diff --git a/ManagerDemo/MainView/ListView/LoanListCell.xib b/ManagerDemo/MainView/ListView/LoanListCell.xib index c808d7a..9fc6da1 100644 --- a/ManagerDemo/MainView/ListView/LoanListCell.xib +++ b/ManagerDemo/MainView/ListView/LoanListCell.xib @@ -7,28 +7,28 @@ - + - + + + + + - + - - - - - + + + + + - + - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ManagerDemo/MainView/ListView/LoanListViewController.m b/ManagerDemo/MainView/ListView/LoanListViewController.m index da18c02..8056120 100644 --- a/ManagerDemo/MainView/ListView/LoanListViewController.m +++ b/ManagerDemo/MainView/ListView/LoanListViewController.m @@ -8,6 +8,7 @@ #import "LoanListViewController.h" #import "AdjustableUILable.h" +#import "LoanListCell.h" @interface LoanListViewController () @end @@ -27,6 +28,7 @@ { [super viewDidLoad]; // Do any additional setup after loading the view. + [_tableView setSectionIndexBackgroundColor:[UIColor blackColor]]; } #pragma mark UITableViewDelegate @@ -34,26 +36,27 @@ return 1; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ - return 30; + return 10; +} +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + CGFloat height = 108.0; + return height; + } -//-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath -//{ -// CGFloat height = 100.0; -// return height; -// -//} -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - static NSString *homeViewCell = @"HomeViewCell"; - UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:homeViewCell]; + static NSString *loanListCell = @"LoanListCell"; + UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:loanListCell]; if (cell == nil) { - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:homeViewCell]; -// AdjustableUILable* label = [[AdjustableUILable alloc] initWithFrame:cell.frame]; -// label.text = @"nihao"; -// label.characterSpacing = 14.0; -// [cell addSubview:label]; + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:loanListCell]; + NSArray *LoanListCellObjects = [[NSBundle mainBundle] loadNibNamed:@"LoanListCell" owner:self options:nil]; + cell = [LoanListCellObjects objectAtIndex:0]; + } - cell.textLabel.text = [NSString stringWithFormat:@" 第 %d 行",indexPath.row]; + [(LoanListCell*)cell setPercent:40]; + NSString* htmlStr = @"12个月"; + [(LoanListCell*)cell setTimeWithString:htmlStr]; return cell; } diff --git a/ManagerDemo/MainViewControll/ProductListViewController.m b/ManagerDemo/MainViewControll/ProductListViewController.m index 873138b..c911d11 100644 --- a/ManagerDemo/MainViewControll/ProductListViewController.m +++ b/ManagerDemo/MainViewControll/ProductListViewController.m @@ -80,14 +80,10 @@ } -//- (void)slideSwitchView:(QCSlideSwitchView *)view panLeftEdge:(UIPanGestureRecognizer *)panParam -//{ -// QCViewController *drawerController = (QCViewController *)self.navigationController.mm_drawerController; -// [drawerController panGestureCallback:panParam]; -//} - (void)slideSwitchView:(QCSlideSwitchView *)view didselectTab:(NSUInteger)number { + DLog(@"%ld",number); }