Tag: ipad

UIPopoverController和UIImagePickerController崩溃

这是我的观点的build立: 当UIBarButtonItem被点击时,它应该调出一个UIImagePickerController 。 我必须使用UIPopoverController来执行此操作,通过单击“重置”button来调用该操作,因为这在iPad上是必需的。 这是我的代码: -(IBAction) btnReset:(id)sender { [self chooseImage]; } -(void) chooseImage { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { imagepicker = [[UIImagePickerController alloc] init]; imagepicker.allowsEditing = NO; imagepicker.delegate = self; imagepicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; imagepicker.navigationBar.opaque = true; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { popoverController = [[UIPopoverController alloc] initWithContentViewController:imagepicker]; [popoverController presentPopoverFromBarButtonItem:reset permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES]; } else { [self presentModalViewController:imagepicker animated:YES]; […]

UIButton标题标签变换切断标签

我正在创build一个大小为30px宽度和164px高度的界面生成器的UIButton。 我想将UIButton的标题旋转到90度。 我正在使用下面的代码进行轮换 // leftNavBtn1 is a UIButton self.leftNavBtn1.titleLabel.transform = CGAffineTransformMakeRotation(-M_PI / 2); 问题是旋转后的标签中断。 我试图编程设置标题,但它不工作。 我想要这样做 我正在得到什么

iTunes Connect截图不接受iPad PRO屏幕截图

我的iPad PRO模拟器不是从iPad AIR模拟器缩放,我有启动屏幕故事板。 所以我从iPad PRO模拟器上截取了一个截图,并尝试将它上传到iTunes Connect的屏幕截图中,但是它给了我一个警告,说明大小是错误的。 为什么iPad PRO模拟器使用不正确的iTunes Connect大小?

iOS的WKWebView JavaScript警报崩溃的iPad

我在这个答案中使用的解决scheme,正确地显示javascript alert / confirm / etc框,它在iphones上效果很好。 func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) { let alertController = UIAlertController(title: nil, message: message, preferredStyle: .actionSheet) alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: { (action) in completionHandler() })) present(alertController, animated: true, completion: nil) } func webView(_ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, initiatedByFrame […]

在GooGle地图上添加UITextField和UiButton

我是iOS新手,正在使用Google Map SDK ,能够在视图上显示地图,但是现在可以显示地图 我想添加一个UITextField并input那里的位置 在button上单击该位置应显示在地图上 所以,请帮助我。

与Cocos2d Spritesheet不显示任何东西

我想写一个演示应用程序来学习如何更好地使用Cocos2d中的精灵表。 到目前为止,我已经准备好了精灵,工作表看起来不错,代码看起来不错,但是精灵没有显示出来! 我有骰子对象包含精灵,和一些function之前select一个随机的脸animation骰子到屏幕上。 这应该就像你在滚动它们一样。 我使用的操作顺序是: 将sprite数据的plist添加到帧caching 创build精灵表批处理节点 初始化Dice对象,select一个随机的面,并将它们添加到精灵表(批处理节点) 将精灵表(批处理节点)添加到游戏图层 这里是整个项目的链接。 随意刺伤它。 https://github.com/rnystrom/MartionDemo 这里是我上面描述的片段,以及Dice对象的作用: // Add spritesheet to the sprite cache [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"spritesheet.plist"]; self.spriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"spritesheet.png"]; for (int i = 0; i < kNumDice; ++i) { // Create Dice object // CODE BELOW HAPPENS HERE AT initRandom Dice* d = [[Dice alloc] initRandom]; // […]

将iPad状态栏方向修正为纵向

我有一个简单的标签栏的iPad应用程序。 我需要修改方向为肖像。 我通过在plist文件的“支持的界面方向”字段中设置“肖像(底部主页button)”来实现。 问题是,在旋转iPad时状态栏仍然移动…我该如何解决? 谢谢阅读。

iPad的模拟器罚款,但iPad上传图片时使用WKWebview崩溃的应用程序

背景和简短摘要 我正在使用WkWebview为了显示我的应用程序的网页。 我拥有它,以便您可以从相机或照片库中select一个图像。 但是,在select图像时,应用程序崩溃似乎存在问题。 眼镜 我在平板电脑上运行IOS 10.0.2,在模拟器上使用Swift 3运行IOS 10.0。我从XCode 8运行。 在模拟器上,当我尝试上传图片时,出现“错误” 我收到以下消息: 2016-10-19 02:15:36.150670 z4[31561:14708540] [Generic] Creating an image format with an unknown type is an error 图像是好的,我可以用它来上传。 我认为这种行为很奇怪,但是我读到它与IOS上的内存pipe理有关 在平板电脑本身,我得到以下 Terminating app due to uncaught exception 'NSGenericException', reason: 'Your application has presented a UIAlertController (<UIAlertController: 0x151e80350>) of style UIAlertControllerStyleActionSheet. The modalPresentationStyle of a UIAlertController with […]

AFNetworking setImageWithURLRequest下载进度

我正在使用此代码将图像设置为UIImageView。 NSURLRequest *URLRequest = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:imageToLoad]]; [imageView setImageWithURLRequest:URLRequest placeholderImage:nil success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) { [cell.image setImage:image]; [cell.activityIndicator stopAnimating]; } failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) { // Nothing }]; 但是我想用这个方法来跟踪下载进度,是否可以在setImageWithURLRequest方法中做到这一点? 通常我会这样来显示加载进度百分比: [SVProgressHUD showWithStatus:@"Start download…"]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:link]]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) […]

仪器中的红线

我正在使用Objective-C进行编程,并在Instrument中testing我的应用程序。 我上传了截图。 我不明白我的代码红线,有什么不对? 你可以帮我吗? 谢谢。