Tag: ios5

自定义左右UISegmentedControlbutton

我试图自定义下面的分段控制,使用第一个button的左图像和第二个button的右图像。 我将如何使用UIAppearance来做到这一点? 我想改变下面的segmentedControl: 到类似如下的东西: 我想使用自定义图像的原因是我可以改变button的angular落。 如果你看看蓝色的分段控制,它更平方(我的图像有它自己的angular落)。 我正在想这样的事情,但没有用。 UIImage *leftImage = [[UIImage imageNamed:@"leftControl.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)]; UIImage *rightImage = [[UIImage imageNamed:@"rightControl.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)]; [[UISegmentedControl appearance] setBackgroundImage:leftImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault ]; [[UISegmentedControl appearance] setBackgroundImage:rightImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

在Storyboard中编辑自定义UIView子类

我有一个应用程序使用UIScrollView页面之间dynamic生成的一些UIViews。 现在,我不得不以编程方式设置这些UIViews的布局和UI元素,但我想知道是否有任何方法来编辑故事板(独立于视图控制器)UIView的子类的接口。 提前致谢。 编辑:仅供参考,我使用iOS 5的Xcode 4.2。

没有在iOS5中selectMKAnnotation

我的应用程序在地图上放置了一个图钉,然后select使用的animation,这样用户就有一个视觉线索,可以立即阅读标题/副标题。 以下代码适用于iOS4和iOS5,但在iOS5中,除非在selectAnnotation方法中将animation更改为NO,否则不会自动select注释。 任何想法为什么? MapAnnotations *pushpin = [[MapAnnotations alloc] initWithCoordinate:coordinate]; pushpin.title = [selectedStation valueForKey:@"name"]; pushpin.subtitle = [selectedStation valueForKey:@"address"]; [stationMap addAnnotation:pushpin]; [stationMap selectAnnotation:pushpin animated:YES]; [pushpin release]; pushpin = nil;

未find<GoogleMaps / GoogleMaps.h>文件的Google Maps SDK for iOS

昨天我收到谷歌的一封电子邮件,说我可以访问ios的地图API,我从应用程序控制台生成了我的密钥,然后按照https://developers.google.com/maps/documentation/ios/start但Xcode抛出这个错误。 #import <GoogleMaps/GoogleMaps.h> //file not found 感谢您的支持。 出现Headers可执行文件而不是文件夹是正常的? 解决了!

将RGB图像转换为1通道图像(黑/白)

如何使用ios5将RGB图像转换为1通道图像(黑/白)? input图像通常是书页的照片。 目标是通过将其复制到1通道图像来缩小复印件的尺寸。

backgroundTimeRemaining返回(35791394分钟)?

我在我的应用程序中使用beginBackgroundTaskWithExpirationHandler。 我了解后台应用程序完成工作的最大时间是10分钟,但是当我打印backgroundTimeRemaining的值时,我得到的是(35791394分钟) NSTimeInterval timeLeft = [UIApplication sharedApplication].backgroundTimeRemaining; NSLog(@"Background time remaining2222: %.0f seconds (%d mins)", timeLeft, (int)timeLeft / 60); 这是正常的,还是看起来我做错了什么?

从ios表面创build一个图像并保存

我试图获取与ios设备的主屏幕相关联的表面,从中创build一个图像并保存。 这是与这个问题相关的 – 从iOS应用程序的屏幕截图 – 模拟显示logging器(内部查询) 。 代码如下: IOMobileFramebufferConnection connect; kern_return_t result; io_service_t framebufferService = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("AppleH1CLCD")); if(!framebufferService) framebufferService = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("AppleM2CLCD")); if(!framebufferService) framebufferService = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("AppleCLCD")); result = IOMobileFramebufferOpen(framebufferService, mach_task_self(), 0, &connect); result = IOMobileFramebufferGetLayerDefaultSurface(connect, 0, &screenSurface); uint32_t aseed; IOSurfaceLock(screenSurface, kIOSurfaceLockReadOnly, &aseed); uint32_t width = IOSurfaceGetWidth(screenSurface); uint32_t height = IOSurfaceGetHeight(screenSurface); CFMutableDictionaryRef dict; int pitch […]

在Uiwebview中显示video不在设备全屏幕中

我想在UIWebview中显示video。 当我们点击video时,它会在设备上全屏播放。 我们如何在UIWebview中播放video? 请注意,这些video文件托pipe在YouTube或我们的服务器上。 他们不与应用程序捆绑在一起

在后台截图(iOS) – 提高性能

这个问题是一个扩展: 从iOS应用程序截图 – 模拟显示logging(查询内部) 我有两种方法从背景中截取屏幕截图 – 1. 从ios表面创build一个图像并保存 – 它以非常快的速度捕获(大约0.2-0.3秒/ 12-15的截图),但是遇到了一些问题,在这里讨论: 释放IOSurface 2.以下代码使用createScreenIOSurface API执行相同的作业: IOSurfaceRef surface = [UIWindow createScreenIOSurface]; UIImage *surfaceImage = [[UIImage alloc] _initWithIOSurface:surface orientation:UIImageOrientationUp]; CFRelease(surface); UIImageSaveToPhotosAlbum(surfaceImage, self, nil, nil); 但是,捕获率非常差,大约0.5-0.7秒/截图。 那么,方法1中面临的问题是否有解决scheme呢? 有没有办法提高方法2的性能?

在iOS中访问设置应用程序

是否有机会通过点击button在iOS中显示settings.app? 它应该与iOS 5.1一起工作,所以“prefs:root …”url是没有select的。 你有一个想法如何解决这个问题?