09 2012 档案
摘要://在 工程下的target - Build Phases --Link Binary With Libraries --添加AudioToolbox.framework //然后在头文件中声明#import <AudioToolbox/AudioToolbox.h> //声音提示#define SOUNDID 1109 //1012 -iphone 1152 ipad 1109 ipad- (IBAction)voiceBtnPress:(id)sender { //一句话解决iphone ipad 声音提示 AudioServicesPlaySystemSo...
阅读全文
摘要://NSMutableDictionary 与 NSMutableArray注意的地方-(void)testDic{ //初始化 NSMutableDictionary *dic = [[NSMutableDictionary alloc]init]; NSMutableDictionary *dic1 = [[NSMutableDictionary alloc]init]; NSMutableArray *arr = [[NSMutableArray alloc]init]; //在里面添加数据 [dic setObject:@"qingjoin" for...
阅读全文
摘要://UIColor *color1 = [UIColor colorWithPatternImage:[UIImage imageNamed:@"left1.png"]]; //UIColor *color2 = [UIColor colorWithPatternImage:[UIImage imageNamed:@"left2.png"]]; //[contactBookBtn setBackgroundColor:color1]; [contactBookBtn setBackgroundImage:[UIImage imageNamed:@&quo
阅读全文
摘要://判断当前输入法-(void)textViewDidChangeSelection:(UITextView *)textView{ NSLog(@"wewe:%@",[[UITextInputMode currentInputMode] primaryLanguage]);//do something en-US为英文。。zh-hans为中文 /* if ([[[UITextInputMode currentInputMode] primaryLanguage] isEqualToString: @"en-US"]) { NSLog(@"en
阅读全文
摘要://在遇到有输入的情况下。由于现在键盘的高度是动态变化的。中文输入与英文输入时高度不同。所以输入框的位置也要做出相应的变化#pragma mark - keyboardHight-(void)viewWillAppear:(BOOL)animated{ [self registerForKeyboardNotifications];}-(void)viewWillDisappear:(BOOL)animated{ [[NSNotificationCenter defaultCenter] removeObserver:self];}- (void)registerForKeyboa...
阅读全文
摘要://当用到UITableView 时。往往背景图片要根据内容的大小而定。但如果不用stretchableImageWithLeftCapWidth。刚图片拉出来会很难看。//图片自动适应内容大小 UIImage *chatImage=[UIImage imageNamed:@"bubble.png"]; chatImage = [chatImage stretchableImageWithLeftCapWidth:22 topCapHeight:14]; NSLog(@"tbvContentSizeForLines:%f",...
阅读全文
摘要://下拉列表动画加载-(void)dropDownListAnimation{ SchoolInHandAppDelegate *app = [[UIApplication sharedApplication]delegate]; //每行的高度 everyListHight = 30; listHight = userCountInFile*everyListHight; presstimes ++; if(_dropDownbackView ==nil) { _dropDownbackView = [[UIScrollView all...
阅读全文
摘要://保存用户名和密码-(void)saveAccountOrPwd{ NSMutableDictionary *recorder = [NSMutableDictionary dictionary]; [recorder setObject:loginName.text forKey:LOGIN_NAME]; NSMutableArray *array = [[NSMutableArray alloc]init]; //array = [NSMutableArray arrayWithContentsOfFile:LOGIN_RECORDEDFILE]; ...
阅读全文
摘要:UIActivityIndicatorView *_aiView; //用来加载动画 UIButton *_clickMask; //button//加载动画-(void)loginAnimationActivityIndicatorView{ _clickMask = [UIButton buttonWithType:UIButtonTypeCustom]; [_clickMask setFrame:[UIScreen mainScreen].bounds]; [self.view addS...
阅读全文
摘要://设置选中的方式。一共有三种。cell.selectionStyle = UITableViewCellSelectionStyleNone;//三种效果typedef enum { UITableViewCellSelectionStyleNone, UITableViewCellSelectionStyleBlue, UITableViewCellSelectionStyleGray} UITableViewCellSelectionStyle;//选中后的字体颜色设置 cell.resultTableContent.highlightedTextColor = [UI...
阅读全文
摘要://用于向上偏移高度,也就是说隐藏tableView前面高度为50的区域。不让它显示。。[Tableview setContentInset:UIEdgeInsetsMake(-50, 0, 0, 0)];
阅读全文