2つのテーブルビューのセルの間のスペースを与える、私はFacebookの中で同じように2 UItableviewcellsの間にスペースを追加する方法を見つけ、解決策が親切に以下のコードObjective Cの - IOS
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
cell.contentView.backgroundColor = [UIColor whiteColor];
UIView *whiteRoundedView = [[UIView alloc]initWithFrame:CGRectMake(8, 8, self.view.frame.size.width-18, cell.contentView.frame.size.height - 18)];
CGFloat colors[]={1.0,1.0,1.0,1.0};//cell color white
whiteRoundedView.layer.backgroundColor = CGColorCreate(CGColorSpaceCreateDeviceRGB(), colors);
whiteRoundedView.layer.masksToBounds = false;
whiteRoundedView.layer.cornerRadius = 5.0;
whiteRoundedView.layer.shadowOffset = CGSizeMake(-1, 1);
whiteRoundedView.layer.shadowOpacity = 0.3;
whiteRoundedView.layer.shadowColor = [UIColor lightGrayColor].CGColor;
[cell.contentView addSubview:whiteRoundedView];
[cell.contentView sendSubviewToBack:whiteRoundedView];}
をチェック見つかった
このコードは私に出力を与えています私はしたいが問題は それは何度も呼び出して、私はtablview をスクロールすると、私のアプリケーションを遅くすると私はスクロールダウンしながら影が増加し続けている 誰もこの問題で私を助けることができますか?
UITableViewCellの下部にUIViewを追加することができますが、これはパフォーマンスに影響しません。 –
これを確認してください:https://stackoverflow.com/questions/17490203/how-to-create-paddingspacing-between-rows-in-tablview/17490283#17490283 – brianLikeApple