Tag: button

停止游戏的应用程序,如果主页button点击iOS

我不知道苹果的规则是否有必要实现,当用户在游戏中,如果他们点击主页button,游戏暂停,当他们回到游戏中时,游戏将取消暂停。 我是否必须点击故事板上的某个主页button才能出现? 我不知道。 由于故事板上没有主页button,因此当用户单击主页button退出应用程序时,如何编码,游戏会暂停。 当他们再次返回时,游戏将取消暂停。

Facebook和Twitter分享button停止工作

最近我有这个工作,但现在只是停了下来。 按下button时不做任何操作。 这个代码甚至不会给出断点或错误。 哪里不对? 下载项目(3.2mb) – (IBAction)ShareFB { if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) { slComposeViewController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; [slComposeViewController addImage:[UIImage imageNamed:@"logo-carrito.png"]]; [slComposeViewController addURL:[NSURL URLWithString:@"http://www.google.com"]]; [self presentViewController:slComposeViewController animated:YES completion:NULL]; } else { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"No FB Account" message:@"There are no FB account registered. Configure one" delegate:nil cancelButtonTitle:@"Dissmiss" otherButtonTitles:nil]; [alert show]; } } – (IBAction)ShareTW { […]

当文本被放入标签时,Xcode会出现问题

这是我的情况: 有8个ImageViews。 左边的4在我的代码中被调用(从顶部开始):Left1,Left2,Left3,left4。 右边的4(总是从顶部开始):Right1,Right2,Right3,Right4。 然后在中间有两个红色的button:“上”和“下”和一个标签。 应该发生的是,当按下button时,所有的ImageViews都会在代码中设置的屏幕上方(所以它们的center.y <0)位于上方,当发生这种情况时标签文字设置为“上”。 相反,当按下button时,所有ImageView将返回到初始位置,并将标签文本设置为“Down”。 反而会发生的是label.text根据我的代码而改变,但是我的ImageView不会移动。 这是我的代码: 首先我宣布的对象: class ViewController: UIViewController { @IBOutlet weak var Up: UIButton! @IBOutlet weak var Down: UIButton! @IBOutlet weak var Lab: UILabel! @IBOutlet weak var Left1: UIImageView! @IBOutlet weak var Left2: UIImageView! @IBOutlet weak var Left3: UIImageView! @IBOutlet weak var Left4: UIImageView! @IBOutlet weak var Right1: UIImageView! […]

iOS9导航栏后退button不起作用

一切工作在iOS 9之前完美。 但是,当应用程序在iOS 9上运行时,当点击返回button时没有任何反应,所以我无法返回,因为它保持灰色。 而且,在第一轮之后,我无法继续下一个观点。 例如, 主页 – >点击一个button,继续查看1 – > Segued查看1 – >点击一个button继续查看2 – >没有任何反应 我使用下面的代码执行segue, UIViewController *push = [self.storyboard instantiateViewControllerWithIdentifier:@"storyboard_id"]; [self.navigationController pushViewController:push animated:YES]; 这个问题只发生在iPhone上 但在模拟器上运行时,该应用程序完美无瑕 。 感谢您的帮助。

Swift:在iOS8中旋转一个button?

比方说,我的ViewController上有一个或多个100 * 50的矩形button。 import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } @IBAction func myButton(sender: UIButton) { } } 通常我把我的graphics图像作为他们的形象。 然后我应用自动布局。 但! 我需要他们倾斜不水平,如果你有一个正方形IE,我需要旋转它是一个钻石(45°),这是相同的。 我知道这是不可能通过接口生成器。 […]

使用IBOutlet设置一个UIBarButtonItem的颜色

我似乎无法在堆栈上find这个地方,因为每个解决scheme都提到了如何通过AppDelegate或通过设置外观来设置自定义外观 。 我所需要的只是设置一个,只有这一个UIBarButtonItem使用一个名为colorWithHexString:来自类扩展(添加到项目)的方法自定义hexColor。 我的财产: @property (weak, nonatomic) IBOutlet UIBarButtonItem *grNextButton; 我想在我的.m文件中使用什么: grNextButton.tintColor = [UIColor colorWithHexString:@"#669900"]; 我需要成功更改grNextButton的代码是什么?

如何在iOS应用程序中按下button时列出button

我不知道要search什么或叫什么,因为我是全新的。 请帮我,当我按下button时,会显示其他button。 我们在很多应用程序中发现它,但是我不知道名称。我在下面附上它的图片。 我怎样才能在iOS应用程序中做到这一点。

iOS:在用户键入TextView(xcode)之后,不能最小化键盘

另一位用户提供了以下代码,以便在用户键入特定的TextView时在键盘上方创build一个迷你工具栏。 我所需要的只是一个小小的“closures”button,以便在用户完成时最小化键盘,因此他/她可以继续操作应用程序。 -(void)viewDidLoad { [super viewDidLoad] UIToolbar *inputAccessoryView = [[UIToolbar alloc]init]; // Create one input accessory view, tool bar will be easy for you inputAccessoryView.frame = CGRectMake(0,self.view.frame.size.height – 44, self.view.frame.size.width, 44); // Add required buttons UIBarButtonItem *fontItem = [[UIBarButtonItem alloc] initWithTitle:@"Font" style:UIBarButtonItemStyleBordered target:self action:@selector(changeFont:)]; UIBarButtonItem *removeItem = [[UIBarButtonItem alloc] initWithTitle:@"Remove" style:UIBarButtonItemStyleBordered target:self action:@selector(removeTextView:)]; //Use this […]

当我的应用程序处于后台时,在iOS上捕捉硬件button

我想要执行一些代码,当用户按家庭,电源或音量button(这不重要,其中哪一个)。 我想赶上事件甚至应用程序是最小化到背景和设备正在睡觉。 所以首要的任务是处理事件,当设备在用户的口袋里,用户按下button,但不能取出设备。 那可能吗? 如果电源button不可能,可能是音量或家庭button? 我该怎么做?

无法使用附件指示器继续使用

我有一个三转换(参见下面的代码)。 第一个从一个button。 这是完美的。 第二个是通过点击表格视图中的单元格。 那个也是完美的。 第三个是tableview单元格中的附件button。 这个打开正确的视图控制器,但没有传递给病人的引用,因为我已经编码。 我已经在新的视图控制器的viewDidLoad中的NSLog语句validation了这一点,它显示病人为空。 -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"addPatient"]) { // to add a new patient (selection segue) UINavigationController *navigationController = segue.destinationViewController; RXAddPatientViewController *addPatientViewController = (RXAddPatientViewController*)navigationController.topViewController; Patient *addPatient = [NSEntityDescription insertNewObjectForEntityForName:@"Patient" inManagedObjectContext:[self managedObjectContext]]; addPatientViewController.addPatient = addPatient; } if ([[segue identifier] isEqualToString:@"toPrescriptions"]) { // to view prescriptions for the […]