I know how to set the vertical alignment of a button with IB; see here. But I can not do it programmatically... This is one of the things I have tried:
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(10, 10, 110, 130)];
[button setTitle:@"Align" forState:UIControlStateNormal];
button.backgroundColor = [UIColor whiteColor];
button.titleLabel.textColor = [UIColor grayColor];
[button setContentVerticalAlignment:UIControlContentVerticalAlignmentBottom];
[self.view addSubview:button];
[button release];
I have also tried insets...
But the alignment won't change.
Please note that I want to keep the CustomStyle of the button (I don't want the default look and feel).