私は、iPhone プログラミングが初めてなので、ボタンを目的の位置に合わせることができませんでした。Googleを検索すると、コードに含まれているコードがいくつかありました。私はコードを添付しています
-(void)viewDidLoad
{
[super viewDidLoad];
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self action:@selector(method)forControlEvents:UIControlEventTouchDown];
[button setTitle:@"forward" forState:UIControlStateNormal];
button.frame = CGRectMake(60, 70, 70, 60);
[self.view addSubview:button];
button.titleLabel.textColor = [UIColor redColor];
button.titleLabel.textAlignment = UITextAlignmentRight; //IT IS NOT WORKING
// button.titleLabel.font = [UIFont boldSystemFontOfSize:FONT_SIZE];
//[button setTitle:fromButton.titleLabel.text forState:UI
// Do any additional setup after loading the view, typically from a nib.
}
このコードでボタンを右に揃えましたが、デフォルトの位置にあります。変化なし。よろしくお願いします。前もって感謝します