Tag: uiactionsheet

如何在IOS中创build操作表删除

我想创build与删除button红色和取消button的动作表相同的波纹pipe图片。 我怎样才能做到这一点? 非常感谢

UITextField键盘不能input任何内容

加载一个xib文件作为一个UIView,我得到了一个UITextFieldforms的Xib文件(它只是一个包含文本框和button的视图)。 但是,当应用程序启动,文本框出现。 我无法在此UITextField上input任何字母。 但粘贴一个文本到该UITextField是好的。 为什么? 这是我的添加代码 -(IBAction)showSheet{ UIView *myView = [[[NSBundle mainBundle] loadNibNamed:@"LoginViewComp" owner:self options:NULL] lastObject]; [myView setFrame:CGRectMake(0, 44, 320, 400)]; UIButton *btn1 = (UIButton *)[myView viewWithTag:101]; UITextField *field = (UITextField *)[myView viewWithTag:102]; UILabel *lbl = (UILabel *)[myView viewWithTag:103]; [field setEnabled:YES]; [btn1 addTarget:self action:@selector(testBtn1) forControlEvents:UIControlEventTouchUpInside]; DTActionSheet *sheet = [[DTActionSheet alloc] initWithContentView:myView sheetTitle:@"Demo"]; [sheet showInView:self.view]; [sheet […]

通过UIAlertView显示UIActionSheet

对于特定的服务器通知,我应该显示一个UIActionSheet。 但这里的问题是,当这个事件来了,同时,如果有任何UIAlertView已经显示在任何视图控制器上,它使UIActionSheet禁用(按下确定的警报视图,我不能够select视图控制器上的任何东西,视图被禁用,因为的UIActionSheet)。 任何人都面临这样的问题,任何想法如何解决? 我已经试图在显示操作表之前closures警报视图,但是我需要closures哪个警报视图,因为在许多控制器中有许多警报视图。 所有这些控制器都是本地的。 如何解决这个问题呢。 注意:同样的问题不会出现在iPod上,因为在回复UIActionSheet之前,不会允许点击确定。

单击UIActionSheet中的button会导致我的应用程序崩溃

我试图实现UIActionSheet将有一些共享button,以分享到微博,脸谱,电子邮件和打印。 这是我的共享视图controller.h @interface ShareViewController : UITableViewController <UIActionSheetDelegate, MFMailComposeViewControllerDelegate> @property (nonatomic, strong) NSMutableDictionary *services; @property (strong, nonatomic) UIActionSheet *actionSheet; @property (strong, nonatomic) id <ShareViewControllerDelegate> delegate; @property (nonatomic, strong) UIPopoverController *popCon; @property (nonatomic, strong) NSString *serviceTitle; -(IBAction)loadActionSheet:(id)sender; – (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex; – (void)tweetThis; – (void)printThis; – (void)openMail; – (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error; @end 这是我的共享视图controller.m -(IBAction)loadActionSheet:(id)sender{ if (self.actionSheet) { […]

UIActionSheet从子视图控制器显示iPad崩溃

我很抱歉,如果这已被问,但我似乎无法find任何地方。 我甚至在一个演示项目中重新创build了我的问题,以防你想亲眼看到它,尽pipe我不知道应该在哪里发布。 我有一个xibless基于UINavigationController的应用程序。 我的一些子ViewControllers在顶部右侧有一个button,然后显示一个UIActionSheet。 我的应用程序专为iPhone和iPaddevise,所以当我准备好显示UIActionSheet时: UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat:@"%@ Menu", [self title]] delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Email", @"Print", nil]; [actionSheet setActionSheetStyle:UIActionSheetStyleDefault]; if ([actionSheet respondsToSelector:@selector(showFromBarButtonItem:animated:)]) [actionSheet showFromBarButtonItem:[[self navigationItem] rightBarButtonItem] animated:YES]; else [actionSheet showInView:[self view]]; [actionSheet release]; 在iPad上,我试图显示UIActionSheet附加到正确的栏button,并在iPhone上它应该从底部滑入。 所有这些都很好用。 不幸的是,如果你点击button,并在iPad上显示菜单,但点击应用程序左上angular的后退button,菜单不会消失。 相反,UINavigationController尽职尽责地popup,UIActionSheet仍然在那里。 如果你尝试点击菜单上的东西,你当然会崩溃。 如果用户在屏幕上点击了其他任何东西而不是“后退”button,则菜单会正常closures。 如果你在iPhone上试用这个testing,一切都按预期工作。 没有问题。 我的演示项目有一个AppDelegate和一个ViewController,这是关于它。 AppDelegate生成一个NSDictionary的NSDictionary,所以我有一个模型,我可以通过演示这个问题。 ViewController显示字典的所有关键字,如果相应的值是一个NSDictionary,您可以点击它来深入查看。

ios – 当InApp邮件命令被调用时,应用程序崩溃

当我通过UIActionSheetbutton填充消息撰写表时,我得到以下错误。 对不起,这些对我来说没有多大意义 – 还在学习:-) 任何人都可以帮忙吗? 这是问题的来源。 这是在日志中: 2012-06-16 19:10:43.437 Multi Web [2665:4013] XPCProxy收到坏消息:目标没有提供bodyFinishedDrawing 2012-06-16 19:10:43.489 Multi Web [2665:907] _serviceViewControllerReady:error :错误域= XPCObjectsErrorDomain代码= 3“该操作无法完成(XPCObjectsErrorDomain错误3)” 干杯杰夫 if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init]; mailer.mailComposeDelegate = self; NSString *subject = [[NSString alloc] initWithFormat:@"Multi Web – Sending %@.txt", _documentFile]; [mailer setSubject:subject]; // Attach an image to the […]

如何添加在UIActionsheet的button,我可以在iphone中创build刻度标签的复选标记?

我想弄清楚如何添加一个复选标记到UIActionSheet中的button的右侧。 在UIActionSheet的button中添加此复选标记是否有安全的方法? 有没有更简单的方法来添加复选标记在UIActionsheet的button,而不使用私人API?

从一个button的LongPress手势提供的iOS UIActionSheet错误地需要双击button来解除

我有一个tabbar应用程序,在我有一个MKMapView的选项卡之一。 在这个视图中,我的viewDidLoad我正在初始化一个UIButton的长按手势识别器。 当这个button被按下,并帮助它出现一个UIActionSheet 5button+取消button。 每个button代表缩放级别:“世界”,“国家”,“国家”,“城市”,“当前位置”。 在UIActionSheet中select一个button可以将底层MKMapView放大到这个级别。 我遇到的问题是所有button(包括取消button)都需要双击才能closuresUIActionSheet。 这不是预期的行为 – 按下button后,应该像其他UIActionSheet一样解散。 第一次按下后,我可以看到地图缩放到UIActionSheet后面的适当级别,所以我知道触摸正在注册在正确的button上,但button在第一次按下时不会高亮显示蓝色,并且UIActionSheet不会消除。 直到我再次按下button,它会突出显示蓝色,然后解散。 如果我删除了longpress手势识别器并将UIActionSheet显示在“内部修改”上,那么所有内容都按原样运行。 所以我知道这个手势是干扰的,任何想法的解决方法或解决方法? 或者这是一个应该向苹果报告的错误? – (void) viewDidLoad { // intitialize longpress gesture UILongPressGestureRecognizer *longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(zoomOptions:)]; longPressRecognizer.minimumPressDuration = 0.5; longPressRecognizer.numberOfTouchesRequired = 1; [self.currentLocationButton addGestureRecognizer:longPressRecognizer]; } – (IBAction) zoomOptions:(UIGestureRecognizer *)sender { NSString *title = @"Zoom to:"; UIActionSheet *zoomOptionsSheet = [[UIActionSheet alloc] initWithTitle:title […]

使用长按时出现两个动作表

在我的viewDidLoad里面,我有以下几点: UILongPressGestureRecognizer *longpressGesture =[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongpressGesture:)]; longpressGesture.minimumPressDuration = 1; longpressGesture.allowableMovement = 5; longpressGesture.numberOfTouchesRequired = 1; [self.tableView addGestureRecognizer:longpressGesture]; [longpressGesture release]; 我创build了以下内容: -(IBAction) handleLongpressGesture:(UIGestureRecognizer *) sender { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Delete Record?" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"Yes",@"No",nil]; [actionSheet showInView:self.view]; [actionSheet release]; } 使用模拟器,当我长时间按下时,两个动作表显示出来,而不是一个。 任何想法,为什么这是这样的? 这是模拟器的问题吗?

显示操作表导致CGContext无效的上下文错误

我正在使用操作表来显示供用户select的数据列表。 问题是显示使用[self.actionSheet showInView:self.view]; 导致几个CGContext错误。 相同的代码在iOS 6中运行良好。 码: self.actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:nil cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; [self.actionSheet setActionSheetStyle:UIActionSheetStyleBlackOpaque]; CGRect tableFrame = CGRectMake(0, 40, 320, 214); self.tableView = [[UITableView alloc] initWithFrame:tableFrame style:UITableViewStylePlain]; self.tableView.dataSource = self; self.tableView.delegate = self; [self.actionSheet addSubview:self.tableView]; UISegmentedControl *closeButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObject:@"Done"]]; closeButton.momentary = YES; closeButton.frame = CGRectMake(260, 7.0f, 50.0f, 30.0f); […]