0

http://www.iphone-tips-and-advice.com/image-files/skype-for-iphone-new-account.jpghttp://cdn.trickyways.com/のようなログイン画面を作成しようとしていますwp-content/uploads/2009/08/login-facebook-on-iphone.png .多くの方法を試しましたが、達成できませんでした.tableviewの静的セルでエラーが発生しました.quickdialogを試しましたが、nibファイルがあります.ストーリーボードで同じことを行う方法がわかりません。ヘルプとガイダンスをいただければ幸いです。前もって感謝します。

4

1 に答える 1

1

セルが2つしかないグループ化された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インスタンスです。

于 2012-11-26T11:53:24.040 に答える