我有我的縮放按鈕,CGRectMake的問題。正如你可以在下面看到的那樣,它應該可以工作,但它根本不會改變。問題與CGRectMake的按鈕大小
GameTwo = [UIButton buttonWithType:UIButtonTypeRoundedRect];
GameTwo.titleLabel.font = [UIFont systemFontOfSize:22];
GameTwo.titleLabel.lineBreakMode = UILineBreakModeHeadTruncation;
[GameTwo setTitle:(@"Game Two") forState:UIControlStateNormal];
GameTwo.frame = CGRectMake(10, 10, 100, 50);
[GameTwo addTarget:self action:@selector(gameTwo) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:GameTwo];
我想我也有兩個問題。如何根據縱向模式和橫向模式更改按鈕尺寸。
你知道一個8×像素按鈕將是什麼樣子? – Joe
+1喬我改變了它。 –
好的更好,也許現在你可以看到一些有意義的事情,現在看看這個文章http://www.techotopia.com/index.php/IOS_4_iPhone_Rotation,_View_Resizing_and_Layout_Handling並轉到名爲「編碼佈局和大小的變化」 – Joe