diff --git a/ManagerDemo.xcodeproj/project.pbxproj b/ManagerDemo.xcodeproj/project.pbxproj index de445e6..194dd28 100644 --- a/ManagerDemo.xcodeproj/project.pbxproj +++ b/ManagerDemo.xcodeproj/project.pbxproj @@ -23,6 +23,8 @@ A93F8806199A077F00875287 /* OtherListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A93F87FF199A077F00875287 /* OtherListViewController.m */; }; A94FE51E199C9C3C00626DE5 /* MoveSocialCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = A94FE51D199C9C3C00626DE5 /* MoveSocialCellView.m */; }; A94FE520199C9C6800626DE5 /* MoveSocialCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A94FE51F199C9C6800626DE5 /* MoveSocialCellView.xib */; }; + A96F2A7C199D008200608237 /* UIButton+Bootstrap.m in Sources */ = {isa = PBXBuildFile; fileRef = A96F2A7B199D008200608237 /* UIButton+Bootstrap.m */; }; + A96F2A7F199D01C000608237 /* NSString+FontAwesome.m in Sources */ = {isa = PBXBuildFile; fileRef = A96F2A7E199D01C000608237 /* NSString+FontAwesome.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 */; }; @@ -150,6 +152,10 @@ A94FE51C199C9C3C00626DE5 /* MoveSocialCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoveSocialCellView.h; sourceTree = ""; }; A94FE51D199C9C3C00626DE5 /* MoveSocialCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MoveSocialCellView.m; sourceTree = ""; }; A94FE51F199C9C6800626DE5 /* MoveSocialCellView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MoveSocialCellView.xib; sourceTree = ""; }; + A96F2A7A199D008200608237 /* UIButton+Bootstrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+Bootstrap.h"; sourceTree = ""; }; + A96F2A7B199D008200608237 /* UIButton+Bootstrap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+Bootstrap.m"; sourceTree = ""; }; + A96F2A7D199D01C000608237 /* NSString+FontAwesome.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+FontAwesome.h"; sourceTree = ""; }; + A96F2A7E199D01C000608237 /* NSString+FontAwesome.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+FontAwesome.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 = ""; }; @@ -329,6 +335,17 @@ path = MoveView; sourceTree = ""; }; + A96F2A79199D007700608237 /* UIButtonUtil */ = { + isa = PBXGroup; + children = ( + A96F2A7D199D01C000608237 /* NSString+FontAwesome.h */, + A96F2A7E199D01C000608237 /* NSString+FontAwesome.m */, + A96F2A7A199D008200608237 /* UIButton+Bootstrap.h */, + A96F2A7B199D008200608237 /* UIButton+Bootstrap.m */, + ); + path = UIButtonUtil; + sourceTree = ""; + }; A988A8F9199A50B600EB10AA /* UIViewShape */ = { isa = PBXGroup; children = ( @@ -478,6 +495,7 @@ A9AF6C4A19949B510076C0EE /* Common */ = { isa = PBXGroup; children = ( + A96F2A79199D007700608237 /* UIButtonUtil */, A988A8F9199A50B600EB10AA /* UIViewShape */, A93F87C71999E4DA00875287 /* AttributedString */, A93F877D1999B91600875287 /* SlideSwitch */, @@ -803,7 +821,9 @@ A9AF6C3D199486CA0076C0EE /* ProductListViewController.m in Sources */, A93F87741999AA8300875287 /* ManagerUtil.m in Sources */, A9AF6C941994C5700076C0EE /* UIScrollView+Extension.m in Sources */, + A96F2A7C199D008200608237 /* UIButton+Bootstrap.m in Sources */, A9AF6C47199498D10076C0EE /* MoreViewController.m in Sources */, + A96F2A7F199D01C000608237 /* NSString+FontAwesome.m in Sources */, A9EAA035199857F5001A872A /* HomeMainView.m in Sources */, A93F8805199A077F00875287 /* LoanListViewController.m in Sources */, A9AF6C951994C5700076C0EE /* UIScrollView+MJRefresh.m in Sources */, diff --git a/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate b/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate index 056e4a3..85f0b8f 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/ManagerConstants.h b/ManagerDemo/Common/ManagerConstants.h index 685d1e4..163f548 100644 --- a/ManagerDemo/Common/ManagerConstants.h +++ b/ManagerDemo/Common/ManagerConstants.h @@ -25,4 +25,9 @@ * 系统字体 */ #define Font_Black(fontsize) [UIFont fontWithName:@"HelveticaNeue-Bold" size:fontsize]; + +/** + * 点击的背景颜色 + */ +#define Touch_BackGroudColor [UIColor colorWithWhite:0.5 alpha:0.1] #endif diff --git a/ManagerDemo/Common/ManagerUtil.h b/ManagerDemo/Common/ManagerUtil.h index 98a7886..263f9f7 100644 --- a/ManagerDemo/Common/ManagerUtil.h +++ b/ManagerDemo/Common/ManagerUtil.h @@ -28,4 +28,8 @@ * */ +(UIView*)lineWithColor:(UIColor*)color withAlpha:(CGFloat)alpha withFrame:(CGRect)frame; + ++(UIView*)selectBackgroudViewWithFrame:(CGRect)frame; + ++ (UIImage *) buttonImageFromColor:(UIColor *)color withFrame:(CGRect)frame; @end diff --git a/ManagerDemo/Common/ManagerUtil.m b/ManagerDemo/Common/ManagerUtil.m index f08a80e..6e90287 100644 --- a/ManagerDemo/Common/ManagerUtil.m +++ b/ManagerDemo/Common/ManagerUtil.m @@ -67,4 +67,20 @@ [lineView setBackgroundColor:color]; return lineView; } ++(UIView*)selectBackgroudViewWithFrame:(CGRect)frame +{ + UIView* selectBackgroudView = [[UIView alloc] initWithFrame:frame]; + selectBackgroudView.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.1]; + return selectBackgroudView; +} ++ (UIImage *) buttonImageFromColor:(UIColor *)color withFrame:(CGRect)frame{ + CGRect rect = CGRectMake(0, 0, frame.size.width, frame.size.height); + UIGraphicsBeginImageContext(rect.size); + CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextSetFillColorWithColor(context, [color CGColor]); + CGContextFillRect(context, rect); + UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return img; +} @end diff --git a/ManagerDemo/Common/UIButtonUtil/NSString+FontAwesome.h b/ManagerDemo/Common/UIButtonUtil/NSString+FontAwesome.h new file mode 100755 index 0000000..fa0b7a0 --- /dev/null +++ b/ManagerDemo/Common/UIButtonUtil/NSString+FontAwesome.h @@ -0,0 +1,256 @@ +// +// NSString+FontAwesome.h +// +// Created by Pit Garbe on 27.09.12. +// Copyright (c) 2012 Pit Garbe. All rights reserved. +// +// https://github.com/leberwurstsaft/FontAwesome-for-iOS +// +// +// * The Font Awesome font is licensed under the SIL Open Font License +// http://scripts.sil.org/OFL +// +// +// * Font Awesome CSS, LESS, and SASS files are licensed under the MIT License +// http://opensource.org/licenses/mit-license.html +// +// +// * The Font Awesome pictograms are licensed under the CC BY 3.0 License +// http://creativecommons.org/licenses/by/3.0 +// +// +// * Attribution is no longer required in Font Awesome 3.0, but much appreciated: +// "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" +// +// +// ----------------------------------------- +// Edited and refactored by Jesse Squires on 2 April, 2013. +// +// http://github.com/jessesquires/BButton +// +// http://hexedbits.com +// + +#import + +typedef enum { + FAIconGlass = 0, + FAIconMusic, + FAIconSearch, + FAIconEnvelope, + FAIconHeart, + FAIconStar, + FAIconStarEmpty, + FAIconUser, + FAIconFilm, + FAIconThLarge, + FAIconTh, + FAIconThList, + FAIconOk, + FAIconRemove, + FAIconZoomIn, + FAIconZoomOut, + FAIconOff, + FAIconSignal, + FAIconCog, + FAIconTrash, + FAIconHome, + FAIconFile, + FAIconTime, + FAIconRoad, + FAIconDownloadAlt, + FAIconDownload, + FAIconUpload, + FAIconInbox, + FAIconPlayCircle, + FAIconRepeat, + FAIconRefresh, + FAIconListAlt, + FAIconLock, + FAIconFlag, + FAIconHeadphones, + FAIconVolumeOff, + FAIconVolumeDown, + FAIconVolumeUp, + FAIconQrcode, + FAIconBarcode, + FAIconTag, + FAIconTags, + FAIconBook, + FAIconBookmark, + FAIconPrint, + FAIconCamera, + FAIconFont, + FAIconBold, + FAIconItalic, + FAIconTextHeight, + FAIconTextWidth, + FAIconAlignLeft, + FAIconAlignCenter, + FAIconAlignRight, + FAIconAlignJustify, + FAIconList, + FAIconIndentLeft, + FAIconIndentRight, + FAIconFacetimeVideo, + FAIconPicture, + FAIconPencil, + FAIconMapMarker, + FAIconAdjust, + FAIconTint, + FAIconEdit, + FAIconShare, + FAIconCheck, + FAIconMove, + FAIconStepBackward, + FAIconFastBackward, + FAIconBackward, + FAIconPlay, + FAIconPause, + FAIconStop, + FAIconForward, + FAIconFastForward, + FAIconStepForward, + FAIconEject, + FAIconChevronLeft, + FAIconChevronRight, + FAIconPlusSign, + FAIconMinusSign, + FAIconRemoveSign, + FAIconOkSign, + FAIconQuestionSign, + FAIconInfoSign, + FAIconScreenshot, + FAIconRemoveCircle, + FAIconOkCircle, + FAIconBanCircle, + FAIconArrowLeft, + FAIconArrowRight, + FAIconArrowUp, + FAIconArrowDown, + FAIconShareAlt, + FAIconResizeFull, + FAIconResizeSmall, + FAIconPlus, + FAIconMinus, + FAIconAsterisk, + FAIconExclamationSign, + FAIconGift, + FAIconLeaf, + FAIconFire, + FAIconEyeOpen, + FAIconEyeClose, + FAIconWarningSign, + FAIconPlane, + FAIconCalendar, + FAIconRandom, + FAIconComment, + FAIconMagnet, + FAIconChevronUp, + FAIconChevronDown, + FAIconRetweet, + FAIconShoppingCart, + FAIconFolderClose, + FAIconFolderOpen, + FAIconResizeVertical, + FAIconResizeHorizontal, + FAIconBarChart, + FAIconTwitterSign, + FAIconFacebookSign, + FAIconCameraRetro, + FAIconKey, + FAIconCogs, + FAIconComments, + FAIconThumbsUp, + FAIconThumbsDown, + FAIconStarHalf, + FAIconHeartEmpty, + FAIconSignout, + FAIconLinkedinSign, + FAIconPushpin, + FAIconExternalLink, + FAIconSignin, + FAIconTrophy, + FAIconGithubSign, + FAIconUploadAlt, + FAIconLemon, + FAIconPhone, + FAIconCheckEmpty, + FAIconBookmarkEmpty, + FAIconPhoneSign, + FAIconTwitter, + FAIconFacebook, + FAIconGithub, + FAIconUnlock, + FAIconCreditCard, + FAIconRss, + FAIconHdd, + FAIconBullhorn, + FAIconBell, + FAIconCertificate, + FAIconHandRight, + FAIconHandLeft, + FAIconHandUp, + FAIconHandDown, + FAIconCircleArrowLeft, + FAIconCircleArrowRight, + FAIconCircleArrowUp, + FAIconCircleArrowDown, + FAIconGlobe, + FAIconWrench, + FAIconTasks, + FAIconFilter, + FAIconBriefcase, + FAIconFullscreen, + FAIconGroup, + FAIconLink, + FAIconCloud, + FAIconBeaker, + FAIconCut, + FAIconCopy, + FAIconPaperClip, + FAIconSave, + FAIconSignBlank, + FAIconReorder, + FAIconListUl, + FAIconListOl, + FAIconStrikethrough, + FAIconUnderline, + FAIconTable, + FAIconMagic, + FAIconTruck, + FAIconPinterest, + FAIconPinterestSign, + FAIconGooglePlusSign, + FAIconGooglePlus, + FAIconMoney, + FAIconCaretDown, + FAIconCaretUp, + FAIconCaretLeft, + FAIconCaretRight, + FAIconColumns, + FAIconSort, + FAIconSortDown, + FAIconSortUp, + FAIconEnvelopeAlt, + FAIconLinkedin, + FAIconUndo, + FAIconLegal, + FAIconDashboard, + FAIconCommentAlt, + FAIconCommentsAlt, + FAIconBolt, + FAIconSitemap, + FAIconUmbrella, + FAIconPaste, + FAIconUserMd +} FAIcon; + + +@interface NSString (FontAwesome) + ++ (NSString *)stringFromAwesomeIcon:(FAIcon)icon; +- (NSString *)trimWhitespace; +- (BOOL)isEmpty; + +@end \ No newline at end of file diff --git a/ManagerDemo/Common/UIButtonUtil/NSString+FontAwesome.m b/ManagerDemo/Common/UIButtonUtil/NSString+FontAwesome.m new file mode 100755 index 0000000..4474d63 --- /dev/null +++ b/ManagerDemo/Common/UIButtonUtil/NSString+FontAwesome.m @@ -0,0 +1,62 @@ +// +// NSString+FontAwesome.m +// +// Created by Pit Garbe on 27.09.12. +// Copyright (c) 2012 Pit Garbe. All rights reserved. +// +// https://github.com/leberwurstsaft/FontAwesome-for-iOS +// +// +// * The Font Awesome font is licensed under the SIL Open Font License +// http://scripts.sil.org/OFL +// +// +// * Font Awesome CSS, LESS, and SASS files are licensed under the MIT License +// http://opensource.org/licenses/mit-license.html +// +// +// * The Font Awesome pictograms are licensed under the CC BY 3.0 License +// http://creativecommons.org/licenses/by/3.0 +// +// +// * Attribution is no longer required in Font Awesome 3.0, but much appreciated: +// "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" +// +// +// ----------------------------------------- +// Edited and refactored by Jesse Squires on 2 April, 2013. +// +// http://github.com/jessesquires/BButton +// +// http://hexedbits.com +// + +#import "NSString+FontAwesome.h" + +static const NSArray *awesomeStrings; + + +@implementation NSString (FontAwesome) + ++ (NSString *)stringFromAwesomeIcon:(FAIcon)icon +{ + if(!awesomeStrings) { + awesomeStrings = [NSArray arrayWithObjects:@"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", nil]; + } + + return [awesomeStrings objectAtIndex:icon]; +} + +- (NSString *)trimWhitespace +{ + NSMutableString *str = [self mutableCopy]; + CFStringTrimWhitespace((__bridge CFMutableStringRef)str); + return str; +} + +- (BOOL)isEmpty +{ + return [[self trimWhitespace] isEqualToString:@""]; +} + +@end \ No newline at end of file diff --git a/ManagerDemo/Common/UIButtonUtil/UIButton+Bootstrap.h b/ManagerDemo/Common/UIButtonUtil/UIButton+Bootstrap.h new file mode 100755 index 0000000..f69d799 --- /dev/null +++ b/ManagerDemo/Common/UIButtonUtil/UIButton+Bootstrap.h @@ -0,0 +1,20 @@ +// +// UIButton+Bootstrap.h +// UIButton+Bootstrap +// +// Created by Oskar Groth on 2013-09-29. +// Copyright (c) 2013 Oskar Groth. All rights reserved. +// + +#import +#import "NSString+FontAwesome.h" +@interface UIButton (Bootstrap) +- (void)addAwesomeIcon:(FAIcon)icon beforeTitle:(BOOL)before; +-(void)bootstrapStyle; +-(void)defaultStyle; +-(void)primaryStyle; +-(void)successStyle; +-(void)infoStyle; +-(void)warningStyle; +-(void)dangerStyle; +@end diff --git a/ManagerDemo/Common/UIButtonUtil/UIButton+Bootstrap.m b/ManagerDemo/Common/UIButtonUtil/UIButton+Bootstrap.m new file mode 100755 index 0000000..e6a3179 --- /dev/null +++ b/ManagerDemo/Common/UIButtonUtil/UIButton+Bootstrap.m @@ -0,0 +1,94 @@ +// +// UIButton+Bootstrap.m +// UIButton+Bootstrap +// +// Created by Oskur on 2013-09-29. +// Copyright (c) 2013 Oskar Groth. All rights reserved. +// +#import "UIButton+Bootstrap.h" +#import +@implementation UIButton (Bootstrap) + +-(void)bootstrapStyle{ + self.layer.borderWidth = 1; + self.layer.cornerRadius = 4.0; + self.layer.masksToBounds = YES; + [self setAdjustsImageWhenHighlighted:NO]; + [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + [self.titleLabel setFont:[UIFont fontWithName:@"FontAwesome" size:self.titleLabel.font.pointSize]]; +} + +-(void)defaultStyle{ + [self bootstrapStyle]; + [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; + [self setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted]; + self.backgroundColor = [UIColor whiteColor]; + self.layer.borderColor = [[UIColor colorWithRed:204/255.0 green:204/255.0 blue:204/255.0 alpha:1] CGColor]; + [self setBackgroundImage:[self buttonImageFromColor:[UIColor colorWithRed:235/255.0 green:235/255.0 blue:235/255.0 alpha:1]] forState:UIControlStateHighlighted]; +} + +-(void)primaryStyle{ + [self bootstrapStyle]; + self.backgroundColor = [UIColor colorWithRed:66/255.0 green:139/255.0 blue:202/255.0 alpha:1]; + self.layer.borderColor = [[UIColor colorWithRed:53/255.0 green:126/255.0 blue:189/255.0 alpha:1] CGColor]; + [self setBackgroundImage:[self buttonImageFromColor:[UIColor colorWithRed:51/255.0 green:119/255.0 blue:172/255.0 alpha:1]] forState:UIControlStateHighlighted]; +} + +-(void)successStyle{ + [self bootstrapStyle]; + self.backgroundColor = [UIColor colorWithRed:92/255.0 green:184/255.0 blue:92/255.0 alpha:1]; + self.layer.borderColor = [[UIColor colorWithRed:76/255.0 green:174/255.0 blue:76/255.0 alpha:1] CGColor]; + [self setBackgroundImage:[self buttonImageFromColor:[UIColor colorWithRed:69/255.0 green:164/255.0 blue:84/255.0 alpha:1]] forState:UIControlStateHighlighted]; +} + +-(void)infoStyle{ + [self bootstrapStyle]; + self.backgroundColor = [UIColor colorWithRed:91/255.0 green:192/255.0 blue:222/255.0 alpha:1]; + self.layer.borderColor = [[UIColor colorWithRed:70/255.0 green:184/255.0 blue:218/255.0 alpha:1] CGColor]; + [self setBackgroundImage:[self buttonImageFromColor:[UIColor colorWithRed:57/255.0 green:180/255.0 blue:211/255.0 alpha:1]] forState:UIControlStateHighlighted]; +} + +-(void)warningStyle{ + [self bootstrapStyle]; + self.backgroundColor = [UIColor colorWithRed:240/255.0 green:173/255.0 blue:78/255.0 alpha:1]; + self.layer.borderColor = [[UIColor colorWithRed:238/255.0 green:162/255.0 blue:54/255.0 alpha:1] CGColor]; + [self setBackgroundImage:[self buttonImageFromColor:[UIColor colorWithRed:237/255.0 green:155/255.0 blue:67/255.0 alpha:1]] forState:UIControlStateHighlighted]; +} + +-(void)dangerStyle{ + [self bootstrapStyle]; + self.backgroundColor = [UIColor colorWithRed:217/255.0 green:83/255.0 blue:79/255.0 alpha:1]; + self.layer.borderColor = [[UIColor colorWithRed:212/255.0 green:63/255.0 blue:58/255.0 alpha:1] CGColor]; + [self setBackgroundImage:[self buttonImageFromColor:[UIColor colorWithRed:210/255.0 green:48/255.0 blue:51/255.0 alpha:1]] forState:UIControlStateHighlighted]; +} + +- (void)addAwesomeIcon:(FAIcon)icon beforeTitle:(BOOL)before +{ + NSString *iconString = [NSString stringFromAwesomeIcon:icon]; + self.titleLabel.font = [UIFont fontWithName:@"FontAwesome" + size:self.titleLabel.font.pointSize]; + + NSString *title = [NSString stringWithFormat:@"%@", iconString]; + + if(self.titleLabel.text) { + if(before) + title = [title stringByAppendingFormat:@" %@", self.titleLabel.text]; + else + title = [NSString stringWithFormat:@"%@ %@", self.titleLabel.text, iconString]; + } + + [self setTitle:title forState:UIControlStateNormal]; +} + +- (UIImage *) buttonImageFromColor:(UIColor *)color { + CGRect rect = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height); + UIGraphicsBeginImageContext(rect.size); + CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextSetFillColorWithColor(context, [color CGColor]); + CGContextFillRect(context, rect); + UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return img; +} + +@end diff --git a/ManagerDemo/MainView/ListView/FundListCell.xib b/ManagerDemo/MainView/ListView/FundListCell.xib index 5119991..3b7a205 100644 --- a/ManagerDemo/MainView/ListView/FundListCell.xib +++ b/ManagerDemo/MainView/ListView/FundListCell.xib @@ -69,7 +69,7 @@ - + diff --git a/ManagerDemo/MainView/ListView/FundListViewController.m b/ManagerDemo/MainView/ListView/FundListViewController.m index af3bd97..31c0218 100644 --- a/ManagerDemo/MainView/ListView/FundListViewController.m +++ b/ManagerDemo/MainView/ListView/FundListViewController.m @@ -60,8 +60,13 @@ [tableView registerNib:nib forCellReuseIdentifier:loanListCell]; cell = (FundListCell *)[tableView dequeueReusableCellWithIdentifier:loanListCell]; } + cell.selectedBackgroundView = [ManagerUtil selectBackgroudViewWithFrame:CGRectMake(0, 0, 320, [self tableView:tableView heightForRowAtIndexPath:indexPath])]; return cell; } +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:NO]; +} - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; diff --git a/ManagerDemo/MainView/ListView/ListViewController.m b/ManagerDemo/MainView/ListView/ListViewController.m index 82e1c55..6634c55 100644 --- a/ManagerDemo/MainView/ListView/ListViewController.m +++ b/ManagerDemo/MainView/ListView/ListViewController.m @@ -30,6 +30,8 @@ [_tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; self.tableView.delegate = self; self.tableView.dataSource = self; + [self.tableView setUserInteractionEnabled:YES]; + self.tableView.allowsSelection = YES; [self.tableView addHeaderWithTarget:self action:@selector(headerRereshing)]; [self.tableView addFooterWithTarget:self action:@selector(footerRereshing)]; diff --git a/ManagerDemo/MainView/ListView/LoanListCell.xib b/ManagerDemo/MainView/ListView/LoanListCell.xib index 9fc6da1..70f6d81 100644 --- a/ManagerDemo/MainView/ListView/LoanListCell.xib +++ b/ManagerDemo/MainView/ListView/LoanListCell.xib @@ -90,6 +90,6 @@ - + \ No newline at end of file diff --git a/ManagerDemo/MainView/ListView/LoanListViewController.m b/ManagerDemo/MainView/ListView/LoanListViewController.m index cb52eb4..6ceb508 100644 --- a/ManagerDemo/MainView/ListView/LoanListViewController.m +++ b/ManagerDemo/MainView/ListView/LoanListViewController.m @@ -30,6 +30,7 @@ [super viewDidLoad]; // Do any additional setup after loading the view. [self headerBeginRefreshing]; + } #pragma mark MJRefreshDelegate -(void)headerRereshing @@ -58,18 +59,23 @@ { static NSString *loanListCell = @"LoanListCell"; UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:loanListCell]; - if (cell == nil) { + if (cell == nil) { UINib *nib = [UINib nibWithNibName:@"LoanListCell" bundle:nil]; [tableView registerNib:nib forCellReuseIdentifier:loanListCell]; cell = (LoanListCell *)[tableView dequeueReusableCellWithIdentifier:loanListCell]; } + [cell setSelectionStyle:UITableViewCellSelectionStyleDefault]; [(LoanListCell*)cell setPercent:40]; NSString* htmlStr = @"12个月"; [(LoanListCell*)cell setTimeWithString:htmlStr]; + cell.selectedBackgroundView = [ManagerUtil selectBackgroudViewWithFrame:CGRectMake(0, 0, 320, [self tableView:tableView heightForRowAtIndexPath:indexPath])]; return cell; } - +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:NO]; +} - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; diff --git a/ManagerDemo/MainView/ListView/OtherListViewController.m b/ManagerDemo/MainView/ListView/OtherListViewController.m index 0fa97aa..90c7586 100644 --- a/ManagerDemo/MainView/ListView/OtherListViewController.m +++ b/ManagerDemo/MainView/ListView/OtherListViewController.m @@ -63,9 +63,14 @@ } [((FundListCell*)cell).totalLabel setText:@"已经有6783234人"]; + cell.selectedBackgroundView = [ManagerUtil selectBackgroudViewWithFrame:CGRectMake(0, 0, 320, [self tableView:tableView heightForRowAtIndexPath:indexPath])]; return cell; } +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:NO]; +} - (void)didReceiveMemoryWarning { diff --git a/ManagerDemo/MainView/MoveView/MoveSocialCellView.m b/ManagerDemo/MainView/MoveView/MoveSocialCellView.m index 8fd65e6..5d5f069 100644 --- a/ManagerDemo/MainView/MoveView/MoveSocialCellView.m +++ b/ManagerDemo/MainView/MoveView/MoveSocialCellView.m @@ -25,6 +25,10 @@ _attentionBtn.titleLabel.font = [UIFont systemFontOfSize:14.0]; _suggestBtn.titleLabel.font = [UIFont systemFontOfSize:14.0]; _markBtn.titleLabel.font = [UIFont systemFontOfSize:14.0]; + [_friendBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:Touch_BackGroudColor withFrame:_friendBtn.frame] forState:UIControlStateHighlighted]; + [_attentionBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:Touch_BackGroudColor withFrame:_attentionBtn.frame] forState:UIControlStateHighlighted]; + [_suggestBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:Touch_BackGroudColor withFrame:_suggestBtn.frame] forState:UIControlStateHighlighted]; + [_markBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:Touch_BackGroudColor withFrame:_markBtn.frame] forState:UIControlStateHighlighted]; } /* // Only override drawRect: if you perform custom drawing. diff --git a/ManagerDemo/MainView/MoveView/MoveSocialCellView.xib b/ManagerDemo/MainView/MoveView/MoveSocialCellView.xib index f852f13..d64709e 100644 --- a/ManagerDemo/MainView/MoveView/MoveSocialCellView.xib +++ b/ManagerDemo/MainView/MoveView/MoveSocialCellView.xib @@ -30,7 +30,7 @@ - - - -