Iphone Ios应用程序图标类
是否存在与主屏幕上的应用程序图标相对应的UI类 或者类似的按钮,也有摆动效果的方法?简短回答,否 由开发人员使用SDK重新创建这些效果。制作带有图像(应用图标)的自定义UIButton非常简单。然后,只需添加适当的长按手势处理,即可激活按钮的可编辑状态并开始摆动Iphone Ios应用程序图标类,iphone,objective-c,ios,ipad,icons,Iphone,Objective C,Ios,Ipad,Icons,是否存在与主屏幕上的应用程序图标相对应的UI类 或者类似的按钮,也有摆动效果的方法?简短回答,否 由开发人员使用SDK重新创建这些效果。制作带有图像(应用图标)的自定义UIButton非常简单。然后,只需添加适当的长按手势处理,即可激活按钮的可编辑状态并开始摆动 -(void)viewDidLoad { // make a UIButton UIButton *myWiggleButton = [UIButton buttonWithType:UIButtonTypeCustom];
-(void)viewDidLoad {
// make a UIButton
UIButton *myWiggleButton = [UIButton buttonWithType:UIButtonTypeCustom];
// set an image for the button
[myWiggleButton setImage:[UIImage imageNamed:@"my_app_image.png"] forState:UIControlStateNormal];
// add an action and target for the button
[myWiggleButton addTarget:self action:@selector(myButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
// finally add a long touch gesture recognizer
UILongPressGestureRecognizer *longPressGesture =
[[[UILongPressGestureRecognizer alloc]
initWithTarget:self action:@selector(startWiggleMode:)] autorelease];
[myWiggleButton addGestureRecognizer:longPressGesture];
}
-(void)startWiggleMode:(UIGestureRecognizer*)recognizer
{
// start a wiggling animation for the button.
// add a UIButton for the 'x' on top of the wiggling button
}
-(void)myButtonTapped:(id)sender
{
// handle button tap case here.
}
简短的回答是否定的
由开发人员使用SDK重新创建这些效果。制作带有图像(应用图标)的自定义UIButton非常简单。然后,只需添加适当的长按手势处理,即可激活按钮的可编辑状态并开始摆动
-(void)viewDidLoad {
// make a UIButton
UIButton *myWiggleButton = [UIButton buttonWithType:UIButtonTypeCustom];
// set an image for the button
[myWiggleButton setImage:[UIImage imageNamed:@"my_app_image.png"] forState:UIControlStateNormal];
// add an action and target for the button
[myWiggleButton addTarget:self action:@selector(myButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
// finally add a long touch gesture recognizer
UILongPressGestureRecognizer *longPressGesture =
[[[UILongPressGestureRecognizer alloc]
initWithTarget:self action:@selector(startWiggleMode:)] autorelease];
[myWiggleButton addGestureRecognizer:longPressGesture];
}
-(void)startWiggleMode:(UIGestureRecognizer*)recognizer
{
// start a wiggling animation for the button.
// add a UIButton for the 'x' on top of the wiggling button
}
-(void)myButtonTapped:(id)sender
{
// handle button tap case here.
}