随笔分类 - UI
IOS-UI
摘要:- (NSDate *)jsDateFromBeginDate:(NSDate *)beginDate todays:(int)days{ NSDate *dateTemp = [[NSDate alloc]init]; NSTimeInterval interval = 24*60*60*days; dateTemp = [dateTemp initWithTimeInterval:interval sinceDate:beginDate]; return dateTemp;} NSDateFormatter * dateFormatter= [[[NSDa...
阅读全文
摘要:方法一: 可以用nsdate 的 timeIntervalSince1970 方法把时间转换成时间戳进行比较,这里timeIntervalSince1970返回的是NSTimeInterval(double)类型,直接比较就可以了方法二:使用nsdate的compare方法实现- (BOOL)date:(NSDate*)date isBetweenDate:(NSDate*)beginDate andDate:(NSDate*)endDate{ if ([date compare:beginDate] == NSOrderedAscending) return NO; ...
阅读全文
摘要:iPhone-only AppsInclude the following in your application's Resources group in the Xcode project:Table 1iPhone-only apps icon requirements.Image Size (px)File NameUsed ForRequired Status512x512iTunesArtworkAd Hoc iTunesOptional but recommended57x57Icon.pngApp Store and Home screen on iPhone/iPod
阅读全文
摘要:在icon默认情况: 程序的图标会被apple进行美化, 自动圆角, 加上阴影和反光效果;如果不想要这种效果:在Info.plist中添加一个Icon already includes gloss effects并选择YES.
阅读全文
摘要:Advantages:Makes setFrame ofUIPickerViewbehave like it shouldNo transform code within yourUIViewControllerWorks withinviewWillLayoutSubviewsto rescale/position theUIPickerViewWorks on the iPad withoutUIPopoverThe superclass always receives a valid heightWorks with iOS 5Disadvantages:Requires you to
阅读全文
摘要:代码方法://日期阳历转换为农历;- (NSString *)convertDateToNongLi:(NSString *)aStrDate{ NSDate *dateTemp = nil; NSDateFormatter *dateFormater = [[NSDateFormatter alloc]init]; [dateFormater setDateFormat:@"yyyy-MM-dd"]; dateTemp = [dateFormater dateFromString:aStrDate]; NSCalendar* calendar = [[N...
阅读全文
摘要:一: // UIButton *editSome; 为全局变量,已开启ARC; editSome = [UIButton buttonWithType:UIButtonTypeCustom]; editSome.frame = kCCR(0, 0, 45, 25); [editSome setTitle:@"编辑" forState:UIControlStateNormal]; [editSome setTitleColor:[UIColor whiteColor] forState:UIControlStateNor...
阅读全文
摘要:一:引入包和头文件; 需要在frameworks中添加QuartzCore.framework 在接口程序中加上头文件 #import <QuartzCore/QuartzCore.h>二:使用 CATransition *myAnimation = [CATransition animation]; myAnimation.duration = 0.8f; myAnimation.type = kCATransitionPush; myAnimation.subtype = kCATransitionFromBottom; [self.navigat...
阅读全文
摘要:思路: 写一个 UILbel的子类;在子类里面重新布置UILbel的字体间距;如代码 .h#import <UIKit/UIKit.h>@interface AdjustableUILable : UILabel{ CGFloat characterSpacing;}@property CGFloat characterSpacing;@end 代码 .m#import "AdjustableUILable.h"@implementation AdjustableUILable@synthesize characterSpacing;- (id)initWith
阅读全文
摘要:label.font=[UIFontfontWithName:@"Arial-BoldItalicMT"size:24];字体名如下:Font Family: American TypewriterFont: AmericanTypewriterFont: AmericanTypewriter-BoldFont Family: AppleGothicFont: AppleGothicFont Family: ArialFont: ArialMTFont: Arial-BoldMTFont: Arial-BoldItalicMTFont: Arial-ItalicMTFont
阅读全文
摘要:方案一: [self.tableView setAllowsSelection:NO];方案二: [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
阅读全文
摘要:方法一: [historyTodayTableVC setSeparatorStyle:UITableViewCellSeparatorStyleNone];方法二: [historyTodayTableVC setSeparatorColor:[UIColor clearColor]];注意:historyTodayTableVC 为当前的 tableView;
阅读全文
摘要:如同自定义Cell一样,使用UITableView的函数,可以自定义Section:- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;例子代码:- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {NSString *sectionTitle=[self tableView:tableViewtitleForHeaderInSection:se
阅读全文
摘要:问题: 前几下应用,在手机appstore上,从中国区切换到了美国地区,之后,再搜索应用,下载中国区的就不能下载了? 错误提示:总是提示要更改帐户地区;解决方法: 设置---appstore----把当前登录的appid注销掉; 打开手机appstore----搜索一下程序---安装---提示输入appid---输入appid---提示帐户切换到中国--- 切换到中国,就可以下载国内应用了;
阅读全文
摘要:1:保存数据 [[NSUserDefaultsstandardUserDefaults] setObject:@"http://www.baidu.com"forKey:@"selectedURL"];2:取数据 NSLog(@" 正在访问---> %@",[[NSUserDefaultsstandardUserDefaults] objectForKey:@"selectedURL"]);3:官方说明:Getting the Shared NSUserDefaults Instance+standardUs
阅读全文
摘要://设置移动效果-(void)setEditing:(BOOL)editing animated:(BOOL)animated{ [super setEditing:editing animated:animated]; [self.tableView setEditing:editing animated:animated]; }-(BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath{ return YES;}-(void)tableVie...
阅读全文
摘要://1:发布通知-----通知回调方法 NSNotificationCenter *refreshWebNotice = [NSNotificationCenterdefaultCenter]; [refreshWebNotice postNotificationName:@"refreshWeb" object:nil]; //2:接收通知----通知回调方法刷新网页;refreshweb [[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(refreshWeb) name:@&q
阅读全文
摘要:ps的版本不同的,快捷键也不同的,我这有一份整理好的ps3 的你看看能不能用得上,Ps快捷键工具基本快捷键工具箱(多种工具共用一个快捷键的可同时按【Shift】加此快捷键选取) 矩形、椭圆选框工具:【M】 裁剪工具:【C】 移动工具:【V】 套索、多边形套索、磁性套索:【L】 魔棒工具:【W】 喷枪工具:【J】 画笔工具:【B】 像皮图章、图案图章:【S】 历史记录画笔工具:【Y】 像皮擦工具:【E】 铅笔、直线工具:【N】 模糊、锐化、涂抹工具:【R】 减淡、加深、海棉工具:【O】 钢笔、自由钢笔、磁性钢笔:【P】 添加锚点工具:【...
阅读全文
摘要:1:在- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 代理方法里面设置颜色转换逻辑;2:在-(void)viewDidAppear:(BOOL)animated 重新加载 tableview reloadData;- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ stati...
阅读全文
摘要:方式一:- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //cell宽度取系统cell width; CGFloat contentwidth = self.tableView.frame.size.width; //字体大小和下面的 heightForCell保持一致; UIFont *font = [UIFont systemFontOfSize:17.0]; //当前cell数据; NSStri...
阅读全文