1
私は働いているiPhoneアプリを持っていて、sms.appのように大きく動作します。基本的に、キーボードをクリックすると、キーボードが表示されたときに収まるようにtableViewが縮小されます。そして、それをクリックすると隠れ、TableViewは元の高さに戻ります。奇妙なUITableViewCellのアニメーションは、UITableViewフレームを変更するとき
私の問題は、私のUITableViewフレームを元のサイズに戻すと、表示されていないセルが表示される前に奇妙なアニメーションが表示されていたことです。私は主に画像のために伝えることができます。彼らは中心に向かって大きなものから始まり、どこにあるべきかにリサイズします。これはUITableViewの設定ですか?それとも私のコードですか?次の2つの異なるスタイルに二回のUITableViewのスタイルを設定している
// 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] autorelease];
}
// InitWithStyle
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.backgroundColor = [UIColor clearColor];
cell.contentView.backgroundColor = [UIColor clearColor];
// Add subviews here! EX:
// [[cell contenView] addSubview:theObject];
}
はい、それが問題でした。しかし、今私のテーブル全体のビューは台無しです。私はあなたが言ったように 'if(cell == nil){ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];'を実行し、サブビューを追加してから '}'を閉じました。何かご意見は? – iosfreak
UITableViewCellStyleSubtitleを試しましたか?私はそれが2番目に作られていたので –