分类: iOS平台
2015-09-22 09:43:43
return 1; 几个大view
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.reloadlist.count; 几行cell
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell* cell = nil;
static NSString* identifier = @"cell";
cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
}
}-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 65; cell高度
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexPath.row==0)
{
NSString *titileString = [NSString stringWithFormat:@"你点击了按钮%ld", indexPath.row];
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示" message:titileString delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
alert.delegate = self;
[alert show];
}
}
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;这个方法是当View的隐藏动画结束的时候进行回调;[self.navigationController pushViewController:second animated:YES]
[UIView animateWithDuration:0.5 animations:^{
self.underview.transform = CGAffineTransformMakeTranslation(transView.frame.origin.x, 0.0f);
} completion:^(BOOL finished) {
}];
//////////////
导航
//////////////
[self.navigationController setNavigationBarHidden:NO animated:animated];
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"top-bg@2x.png"] forBarMetrics:UIBarMetricsDefault];//设置navigationbar的半透明
self.navigationController.navigationBar.titleTextAttributes = @{UITextAttributeTextColor:[UIColor grayColor]};
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"navigationbar_1@2x.png"] style:UIBarButtonItemStylePlain target:(self) action:@selector(clicked)];
[self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];//设置navigationbar上左右按钮字体颜色
UIButton* buttonview = [UIButton buttonWithType:UIButtonTypeCustom];
[buttonview setTitle:@"明星TOP20" forState:UIControlStateNormal];
//[buttonview setImage:[UIImage imageNamed:@"lv4.png"] forState:UIControlStateSelected];
self.navigationItem.titleView = buttonview;
UIButton* btn = key;
btn.selected = YES;
CGRect r = [ UIScreen mainScreen ].applicationFrame; 求屏幕尺寸
menuView.autoresizingMask = UIViewAutoresizingFlexibleWidth;自动调整自己的宽度,保证与superView左边和右边的距离不变。
[self.dropView removeFromSuperview];
if (![key isKindOfClass:[UIButton class]]) continue;
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",@"^[0-9]{6}$"];
if([predicate evaluateWithObject:inputPwd])
else
NSLog(@"密码错误");
predicate = [NSPredicatepredicateWithFormat:@"engine.horsepower > 150"];
NSArray *results;
results = [carsfilteredArrayUsingPredicate: predicate];
|
|
---|---|
autocapitalizationType |
定义文本自动大小写样式。 UITextAutocapitalizationTypeNone关闭自动大写。 |
autocorrectionType |
定义文本是否使用iPhone的自动更正功能。 UITextAutocorrectionTypeNO不使用该功能。 |
loginTextField.textAlignment = NSTextAlignmentCenter;文字对齐方式
//输入框中是否有个叉号,在什么时候显示,用于一次性删除输入框中的内容
text.clearButtonMode = UITextFieldViewModeAlways;
typedef enum {
UITextFieldViewModeNever, 重不出现
UITextFieldViewModeWhileEditing, 编辑时出现
UITextFieldViewModeUnlessEditing, 除了编辑外都出现
UITextFieldViewModeAlways 一直出现
} UITextFieldViewMode;
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
NSString* toString = [textField.text stringByReplacingCharactersInRange:range withString:string];
if ([toString length] > 6) {
return NO;
}