【发布时间】:2011-01-20 01:50:35
【问题描述】:
我很清楚这是一个简单的问题。我想了解当用户选择它时如何将 CGRect/UIButton 移动到屏幕上的不同位置。提前感谢您的帮助。
- (void)showMeSomeButtons:(CGRect)frame{
button = [[UIButton alloc] initWithFrame:frame];
button.frame = CGRectMake(240, 150, 50, 50);
UIImage *buttonGraphic = [UIImage imageNamed:@"1.png"];
[button setBackgroundImage:buttonGraphic forState:UIControlStateNormal];
[button addTarget:self.viewController action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:button];
}
-(void)buttonClicked{
???
}
【问题讨论】:
标签: ios objective-c cocoa-touch uiview