I want to resize my UISwitch
button which is attach on UITableView
. I found some help on google and did this successfully using CGAffineTransformMakeScale
but with this I am getting an Issue when I change position this switch button it goes its own original size may be because its on table view but I am resizing this in ViewDidLoad
delegate. Here is what I am doing.
- (void)viewDidLoad{
switchFB = [[UISwitch alloc] initWithFrame:CGRectMake(227, 8, 79, 27)];
switchFB.transform= CGAffineTransformMakeScale(0.7, 0.7);}
and in Cell for row at index path
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{`static NSString *CellIdentifier = @"SettingsCell";`
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.backgroundColor = [UIColor clearColor];
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
}
Kindly check this where I am doing wrong and if my procedure is not right way so can you please suggest me some better way to do this. This will be great for me. Thanks in advance.