Tag:

如何在Mapbox中添加一个大图像?

我想添加一个瓷砖来源,基本上是1个PNG大小为800×800。 我创build了一个RMAbstractWebMapSource的子类,实现下面的方法,但它不工作,我得到一个日志错误“瓷砖来源…有不同的瓦片长度比tilesource容器”。 @implementation CustomTileSource – (NSURL *)URLForTile:(RMTile)tile { return [[NSURL alloc] initWithString:@"THE_URL_OF_MY_PNG"]; } – (NSString *)uniqueTilecacheKey { return @"NLSMap"; } – (NSString *)shortName { return @"Map"; } – (NSString *)longDescription { return @"Test"; } – (NSString *)shortAttribution { return @"Google maps"; } – (NSString *)longAttribution { return @"Google maps"; } – (float)minZoom { return 7.0; […]

状态栏框架粘贴到纵向,并遮挡window.view

我正在开发一个支持所有方向的iPad应用程序。 我不使用笔尖。 我有一个UIWindow,提出了四个意见: 其中两个占据全宽,但没有太多的高度。 另外两个占据了高度的大部分,并共享相同的origin.x。 它们不重叠。 我指定一个视图作为主窗口的子视图,其余的子视图都是window.view。 问题:旋转之后,无论方向如何,状态栏的框架都会保持原来的位置(纵向顶部)。 虽然,状态栏确实在旋转。 我没有注意到红眼镜的信息文章。 但是,这并没有出现相同的问题。 这是不同的,红眼镜方法通过将主视图设置为窗口的子视图来覆盖状态栏条。 我采取了这种方法,但问题依然存在。 我已经尝试了重新编译和重新调用willRotateToInterfaceOrientation ::中的window.view框架,但运气不大。 我已经证实,新框架/中心是我所期望的。 看起来好像在后台正在进行一些重构。 我不知道现在该怎么想……我希望有人能够对这个问题有所了解。

在视图控制器之间传递数据 – iOS Xcode – 什么是好方法?

好吧,我会试着尽可能简单(当我试着问这个问题时,我似乎在chat.stackoveflow.com上运行)。 我想将文本从一个视图控制器中的文本传递给另一个视图控制器。 我应该使用一个Model类,并将textfield.text存储在Model。[h / m]文件中,然后让第二个视图控制器访问存储在模型中的数据? 基本上这是我所拥有的, ViewControllerWelcome.h @interface ViewControllerWelcome : UIViewController { } @property (weak, nonatomic) IBOutlet UITextField *textFieldUsername; ViewControllerWelcome.m UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; ViewControllerHome *home = (ViewControllerHome *)[storyboard instantiateViewControllerWithIdentifier:@"Home"]; NSString *username = _textFieldUsername.text; home.lblUSERNAME.text=username; [self presentModalViewController:home animated:YES]; ViewControllerHome.h @interface ViewControllerHome : UIViewController { NSString *username; UILabel *lblUSERNAME; } @property (weak, nonatomic) IBOutlet […]

MapBox:如何删除一个形状并绘制另一个形状?

我为形状创build了注释 _path = [RMAnnotation annotationWithMapView:_mapView coordinate: _userLocation.coordinate andTitle:@"Path"]; [_mapView addAnnotation:_path]; 在我写的代表中 – (RMMapLayer *)mapView:(RMMapView *)mapView layerForAnnotation:(RMAnnotation *)annotation { if ([annotation.title isEqualToString:@"Path"]) { _lineBetweenTwoBeacon = [[RMShape alloc] initWithView:mapView]; _lineBetweenTwoBeacon.lineColor = [UIColor redColor]; _lineBetweenTwoBeacon.lineWidth = 10.0f; return _lineBetweenTwoBeacon; } else { marker = [[RMMarker alloc] initWithUIImage:[UIImage imageNamed:@"userPin"]]; UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 80, 80)]; imageView.contentMode […]

从UIAlertView文本字段获取文本的问题

在我的应用程序,我想要一个文本框的警报。 点击“完成”后,我想将文本字段保存在一个string中。 点击“取消”后,我只想closures警报。 我已经创build了这样的警报: var alert = UIAlertView() alert.title = "Enter Input" alert.addButtonWithTitle("Done") alert.alertViewStyle = UIAlertViewStyle.PlainTextInput alert.addButtonWithTitle("Cancel") alert.show() let textField = alert.textFieldAtIndex(0) textField!.placeholder = "Enter an Item" println(textField!.text) 警报看起来像这样: 我想知道如何从文本框中获取文本,以及如何为“完成”button和“取消”button创build事件。