Change UITableViewCell Frame in layoutSubviews iOS 8

874 Views Asked by At

i am trying to get similar effect of the UITableViewCell in iOS FaceBook App

so i subclassed a UITableViewCell and in the layoutSubviews

i use this code to resize the cell frame

self.frame = CGRectInset(self.frame, 1.5, 1.5)

and for the rounded rect of the cell

self.layer.cornerRadius = 10.0

and it's working with no problem but once any cell gets highlighted the cell gets resized every time the cell is highlighted i think it's because the layoutSubviews called more than once so it's applying the effect every time

Before highlight

After

is there anyway to fix this ?

0

There are 0 best solutions below