【发布时间】:2014-03-11 22:37:28
【问题描述】:
我创建了一个自定义警报视图,我在其中创建了自定义按钮并删除了默认按钮。当我单击自定义按钮时,警报视图不会消失。请帮我解决这个问题。我正在使用以下代码,
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:nil];
[alertView show];
UILabel *lbladdblock=[[UILabel alloc] initWithFrame:CGRectMake(100,25,100,30)];
[alertView addSubview:lbladdblockname];
【问题讨论】:
-
在此处分享您的代码。
-
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:nil]; [警报视图显示]; UILabel *lbladdblock=[[UILabel alloc] initWithFrame:CGRectMake(100,25,100,30)]; [alertView addSubview:lbladdblockname];
-
点击按钮时显示代码。
-
自定义按钮在哪里声明和使用?
-
-(void)gotoWelcomeScreen{ // profileInfoViewController *profile= [self.storyboard instantiateViewControllerWithIdentifier:@"profileInfo"]; scrollingViewController *profile= [self.storyboard instantiateViewControllerWithIdentifier:@"scroller"]; profile.userImagePath=regUserPhoto; profile.phonenum=regPhNumber; profile.selfregistrationId=[NSString stringWithFormat:@"%d",registeredid ]; [self presentModalViewController:profile Animation:YES]; }
标签: ios iphone objective-c