2011-02-15 54 views

回答

2

你將會把偏移按鈕類似-10 (如果你的按鈕周圍30×30) X和Y.

在您的例子,看起來像Pro Switcher,只是看在那裏的源頭,看看他是如何做到的。

2

檢查Matt Gemmell寫的關於他的「收藏夾」應用程序的UI設計。他專門討論那些「關閉」按鈕。

Favorites UI design

0

創建父VIE按鈕和關閉設置其框架的子視圖

button = [UIButton buttonWithType:UIButtonTypeCustom]; 
[button addTarget:self 
       action:@selector(aMethod:) 
    forControlEvents:UIControlEventTouchDown]; 
button.backgroundColor = [UIColor clearColor]; 
[button setBackgroundImage:[UIImage imageNamed:@"close_button.png"] forState:UIControlStateNormal]; 
button.frame = CGRectMake(0, 80, 30, 30); 
[self.view addSubview:button]; 
相關問題