我正在尝试创建像http://www.iphone-tips-and-advice.com/image-files/skype-for-iphone-new-account.jpg和http://cdn.trickyways.com/wp-content/uploads/2009/08/login-facebook-on-iphone.png这样的登录屏幕。我尝试了很多方法但无法实现它。我在tableview中遇到了静态单元格的错误。我试过了quickdialog但它有nib文件我不知道如何在故事板中做同样的事情。 任何帮助和指导将不胜感激。 在此先感谢。
答案 0 :(得分:1)
我设法使用仅有两个单元格的分组UITableView创建此类登录屏幕。 诀窍是将单元格定制为单独的类(Advised)或cellForRowAtIndexPath:方法。
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [_tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.backgroundColor = [UIColor clearColor];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textLabel.alpha = 0.4;
}
if (indexPath.row == 0) {
[cell.contentView addSubview:textField];
}else if (indexPath.row == 1){
[cell.contentView addSubview:passWordField];
}
return cell;
}
textField和passwordfield都是UITextField实例。