2011-02-15 59 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]; 
相关问题