Tag: ipad

通过MKMapView在UIImageView上绘制

我已经为这个问题寻找了很多答案,但是他们中的任何一个似乎都不是我想要的。 很多教程向我展示了如何在代码中添加线条和多边形,而不是徒手画。 我在地图上获得了一个带有UIImageView的MKMapView。 而且我可以在我的UIImageView上画一些,但之后,MKMapView被拖动,绘图不会继续。 我想知道我做错了什么? 这里是我触摸事件的代码: – (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; pointA = [touch locationInView:drawView]; } – (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint currentLocation = [touch locationInView:drawView]; UIGraphicsBeginImageContext(drawView.frame.size); CGContextRef ctx = UIGraphicsGetCurrentContext(); [drawView.image drawInRect:CGRectMake(0, 0, drawView.frame.size.width, drawView.frame.size.height)]; CGContextSetLineCap(ctx, kCGLineCapRound); CGContextSetLineWidth(ctx, 5.0); CGContextSetRGBStrokeColor(ctx, 1.0, 0.0, […]

范围栏在UISearchController中定位

我正在开发一个仅限iPad的应用程序,并且在UIViewController中有一个UITableView。 我设置了一个UISearchController作为UITableView的头部。 这个search控件有三个范围。 我希望范围select器在search栏下方 。 用下面这段代码,我可以在init中得到它,但是当我开始input时,select器向右移动, 并保持在那里 。 这是一个animation: 这里是相关的代码: self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; self.searchController.searchResultsUpdater = self; self.searchController.dimsBackgroundDuringPresentation = NO; self.searchController.searchBar.scopeButtonTitles = @[@"Uno",@"Dos", @"Tres"]; self.searchController.searchBar.delegate = self; self.tableView.tableHeaderView = self.searchController.searchBar; self.searchController.searchBar.showsScopeBar = YES; self.definesPresentationContext = YES; [self.searchController.searchBar sizeToFit]; 提前致谢

encryption或保护iOS应用程序的NSDocumentsDirectory中存储的文件

我有一个自定义要求在我的产品之一,我需要保护或encryption存储在NSDocumentsDirectory文件夹内的文件。 即使这些文件被邮寄(应用程序有能力邮寄文件)给其他人,他或她将不能打开这个文件,而不使用我的应用程序(我将使用电子邮件附件的function打开)。 所以基本上只有应用程序可以访问所有这些文件,没有应用程序的文件应该是垃圾。 有没有办法做到这一点,或者有没有做过一些事情。 我也看到了这一点,但不能得到一个完整的想法。

识别应用程序multitask-kill iPad

熙 有人知道如何识别多任务杀手。 当用户将应用程序置于后台状态,然后通过iOS 4.2中的菜单杀死应用程序时,我的应用程序closures。 之前曾经有一个函数叫做: – (void)applicationWillTerminate:(UIApplication *)application iOS 4及更高版本中不再调用此方法。 有没有办法识别它? 谢谢。

UISplitView与多个故事板

我有一个iPhone应用程序包含概览(表格视图)和多个细节视图(不同种类的意见)。 为了模块化,所有的细节视图都使用单独的故事板。 现在我需要使我的应用程序通用。 为此,我想要使用UISplitView作为主视图,并在右侧加载详细信息视图。 不过,我不确定是否可以用我的多个故事板做到这一点。 我有什么可能? 我必须保持应用程序模块化。 我已经分开iPhone和iPad的故事板,但是这并没有真正帮助我。 我将不胜感激任何build议。

如何完全使用animationWithDuration和transitionWithView

我尝试使用animationWithDuration和transitionWithView来创build一个大的animation。 我想要做这样的事情: 使用animationWithDuration移动视图A. 在step1完成之后,使用animationWithDuration移动视图B. 在step2完成之后,用transitionWithView(With OptionCurlDown)显示视图C, 我真的看过网,我不知道该怎么做。 我的问题是,步骤3始终与步骤A同时开始。如果我只做步骤1和步骤2,这是好的,我的意思是,步骤2只有当步骤1完成时才会启动。 但是我没有第三步的运气! 我也尝试在animationWithDuration中嵌套transitionWithView,但结果是一样的, 谢谢 更新 以下是代码本身: 主function: [fileMenuController hide:0.2 andDelay:0.1]; [drawingToolController show:0.2 andDelay:0.2]; [penSizeMenuController showSubViewWithDuration:0.4]; fileMenuController隐藏function: [UIView animateWithDuration:duration //begin animation delay:delay options:UIViewAnimationCurveEaseIn animations:^{ [self.view setFrame:CGRectOffset([self.view frame], 0, -self.view.frame.size.height)]; } completion:nil ]; drawingToolController显示function: [UIView animateWithDuration:duration //begin animation delay:delay options:UIViewAnimationCurveEaseIn animations:^{ [self.view setFrame:CGRectOffset([self.view frame], 0, self.view.frame.size.height)]; } completion:nil ]; penSizeController显示function: […]

IOS Kiosk模式编码

我期待在我的开发人员iPad上设置一个closures应用程序,以防止使用主页button(最好是锁button)。 我想密码保护离开应用程序本质上。 最好的办法是什么?

如何启动设备types的特定视图

我正尝试在启动时启动3个视图中的1个。 我想要启动的视图取决于设备types。 这是我到目前为止在AppDelegate.m – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568.0) { self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_Portrait5" bundle:nil]; } else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 480.0) […]

第二个UITableView中的单元格填充在顶部

我有两个表视图并排在同一个视图控制器,他们都在他们自己的看法。 右边的第二个被填充,左边的是正确的。 我删除了第二个,并复制第一个,以确保每个设置是100%相同,但仍然不能删除填充,使单元格水平排队。 下面是一个屏幕截图,显示我的故事板,simular和Xcode视图heirarchy,有人请让我知道这是哪里出错。

如何一次显示所有可见元素的热图?

我正在testingHeatmaps SDK ,我想知道是否有一个设置或一种方式来显示在所有可见的元素一次heatmaps? 目前我可以像下面一样查看一个元素。 这是我的设置,下面是结果的图片: – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIViewController *rootVC = _window.rootViewController; self.window = [[HMUIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.rootViewController = rootVC; heatmaps = [[Heatmaps alloc] init]; heatmaps.showDebug = YES; heatmaps.showMenu = YES; [heatmaps start]; //… return YES; }