Tag: button

两个视图控制器之间的ios传递数据没有segue?

我想从一个视图控制器传递数据到另一个视图控制器那些没有连接到彼此与segue.in firstviewcontroller当button触摸(最喜欢)想要数据传递给属于tabbarviewcontroller一部分的secondviewcontroller(favoriteviewcontroller)。 我知道最好的解决scheme也许使用委托? 但我该怎么做呢?

单击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) { […]

如何在用户回到后台应用程序时触发一个function?

例如,用户打开一个应用程序,按下主页button,然后再次返回到应用程序。 当用户导航回应用程序时,有什么办法可以触发某些function吗? 比如当用户回到应用程序时自动加载视图对象。 这个问题适用于Android和iOS。

UITabBarController – 更多button不显示

我以编程方式创build我的TabBarController ,因为我想在每个选项卡中显示不同的内容相同的控制器。 内容由一个ID获取。 我使用的故事板ID与使用initWithNibName:相同的方式。 我在AppDelegate中这样做: – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil]; UITabBarController *tabBarController = [[UITabBarController alloc] init]; for (int i = 0; i < 7; i++) { MyViewController *svc = [storyboard instantiateViewControllerWithIdentifier:@"MyView"]; [svc setID: i]; [tabBarController addChildViewController:svc]; } [self.window makeKeyAndVisible]; [self.window setRootViewController: tabBarController]; return YES; } 但TabBar只显示了7个Tab中的5个。 这很好,因为只有5个选项卡可以同时显示。 不幸的是…更多的button是不可见的。 […]

ios后退button在酒吧

可以在工具栏中插入一个工具button,其形状与导航栏中使用的后退button相似? 这里是我的意思: 提前致谢!

为什么当我select创build的button时,会收到SIGABRT信号?

我在swift 2中创build一个button ,当我select它,我得到信号SIGABRT和应用程序崩溃。 这里是代码: let button = UIButton()//(type: UIButtonType.System) as UIButton! button.setTitle("button", forState: .Normal) button.setTitleColor(UIColor.blueColor(), forState: .Normal) button.addTarget(self, action: "buttonPressed:", forControlEvents: UIControlEvents.TouchUpInside) button.frame = CGRectMake(100, 100, 100, 100) self.view.addSubview(button) func buttonPressed(sender: UIButton!) { print("ButtonIsSelected") } 它带我到AppDelegate.swift和NSLog的中间它说:无法识别的select器发送到实例…请帮助。 安东

如何在iOS中pipe理tableview中的button?

我有问题与tableview。 我有一个tableview和在表单元格创buildbutton和设置标题号。 当用户触摸button的时候,设置button标题是。 但是如何知道标题YES中有多less个button。 请帮帮我………

iOS / Swift:如何实现backButton的longPressed动作?

我试图为我的应用程序中的每个ViewController实现自定义后退button 。 我希望它有两个行动。 如果button被轻敲 ,它应该正常行为,并上升导航堆栈。 如果button按下的时间更长,它应该转到预定义的ViewController。 我怎么才能做到这一点,只有后退快速?

用自定义图像和文本颜色更改后退button

我想在导航栏中更改我的后退button的后退button。 为此,我有这段代码。 UIImage *backButtonImage = [UIImage imageNamed:@"backbutton.png"]; UIButton *backbutton = [UIButton buttonWithType:UIButtonTypeCustom]; backbutton.backgroundColor = [UIColor colorWithPatternImage:backButtonImage]; backbutton.titleLabel.text = @"back"; backbutton.titleLabel.textColor= [UIColor colorWithRed:50/255.0 green:158/255.0 blue:218/255.0 alpha:1.0]; backbutton.frame = CGRectMake(0, 0, backButtonImage.size.width, backButtonImage.size.height); UIBarButtonItem * back = [[UIBarButtonItem alloc] initWithCustomView:backbutton]; [backbutton addTarget:self action:@selector(back_Clicked) forControlEvents:UIControlEventTouchUpInside]; self.navigationItem.leftBarButtonItem = back; 但是我仍然得到标准的后退button。 任何帮助?

iOS浮动button在表视图上

是否有可能在表视图上添加一个小的浮动“设置”button或图像button? 我有一个导航栏上的button,我不想拥挤或删除任何