草庐IT

image_summary

全部标签

ios - 我可以以编程方式列出 Images.xcassets/Something 中的文件吗?

是否可以在Images.xcassets/Something中列出所有图像,以便我可以在表格ListView中显示它们?我试过:NSArray*pngs=[NSBundlepathsForResourcesOfType:@".png"inDirectory:@"Images.xcassets/Something"];NSIntegercount=[pngscount];NSLog(@"%d",count);...但收效甚微。谢谢 最佳答案 不要尝试自己寻找图像文件-将它们视为应用程序包中的私有(private)信息。相反,使用ima

android - iOS 中的模块 react-native-image-picker 总是需要麦克风权限,尽管我没有选择视频,只有摄像头

我正在使用react-native-image-picker(拍照/选择照片)将它们上传到我的服务器。效果很好。为此,我使用了ImagePicker。当我注意到在iOS中,如果我想使用它,该模块需要我的麦克风权限时,问题就来了。我查看了文档,因为它应该发生,他们说如果你想制作视频,你必须拥有麦克风权限。看起来一致,问题是我只用相机只拍照片,不拍视频。这是我的代码:varImagePicker=require('react-native-image-picker');varoptions={title:'AdjuntarImagenes',takePhotoButtonTitle:'Ha

ios - Core Image 在第一次渲染时慢很多倍

我找不到Apple的任何文档来解释为什么这段代码会根据其运行次数以不同的速度运行。-(void)speedTest2:(CIImage*)source{NSTimeIntervalstart=CFAbsoluteTimeGetCurrent();CIFilter*filter=[CIFilterfilterWithName:@"CIColorInvert"];[filtersetValue:sourceforKey:kCIInputImageKey];CGImageRefcgImage=[_contextcreateCGImage:filter.outputImagefromRect:

ios - Xcode 6 : Images Not Showing Up On Device

我正在创建UIImageView(s)并将这些View添加到UIScrollView。当我在模拟器上测试时图像显示,但当我在iphone5s上测试时图像不显示。以下是我尝试过的事情的列表:清理构建重新安装应用然后我想这可能是视网膜图像的问题所以我添加了视网膜图像(图像是白色的png):我是这样使用图像的:UIButton*doneBttn=[UIButtonbuttonWithType:UIButtonTypeCustom];[doneBttnsetImage:[UIImageimageNamed:@"addButton.png"]forState:UIControlStateNorm

ios - CAKeyframeAnimation : contents change back to first image when stopped

我使用以下代码为CALayer的内容设置动画:CAKeyframeAnimation*countanimation=[CAKeyframeAnimationanimation];NSArray*images=[NSArrayarrayWithObjects:(id)[UIImageimageNamed:@"number3"].CGImage,(id)[UIImageimageNamed:@"number2"].CGImage,(id)[UIImageimageNamed:@"number1"].CGImage,nil];[countanimationsetKeyPath:@"conte

ios - Xcode 6 : pdf vector images with transparency

Xcode6现在支持Assets目录中基于pdf矢量的图像。是否可以创建具有透明度的基于pdf矢量的图像? 最佳答案 是的,这当然是可能的,我尝试在测试项目中添加一个PDF作为基于矢量的图像,并且背景颜色正确显示为低谷。你有什么问题吗? 关于ios-Xcode6:pdfvectorimageswithtransparency,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/2591

ios - 椰子 dyld : Library not loaded @rpath Image not found

我目前正在使用Xcode8.1、cocoapods1.2.0.beta.1,并在装有iOS10.1的模拟器上启动我的应用程序。我的应用构建得很好,但是在模拟器中启动应用后,我收到以下错误:dyld:Librarynotloaded:@rpath/AFNetworking.framework/AFNetworkingReferencedfrom:/Users/XXXXX/Library/Developer/CoreSimulator/Devices/XXXXX/data/Containers/Bundle/Application/XXXXX/XXXXX.app/XXXXXReason:i

ios - 为什么 Imageview 总是拉伸(stretch) show image stretched iOS?

我正在使用imageView,它包含不同的图像,但有些图像被拉伸(stretch)了。如何在没有任何拉伸(stretch)的情况下显示图像?我已将contentMode设置为aspectfit。但是,图像不是imageView的大小,而是不同的大小。我想在不拉伸(stretch)的情况下显示相同大小的图像。imageview1=[[UIImageViewalloc]initWithFrame:CGRectMake(30,10,190,190)];imageview1.contentMode=UIViewContentModeScaleAspectFit;imageview1.clips

objective-c - Objective-C : How to maintain image resolution/quality in navigation buttons and tab bars

我正在尝试通过以下代码将图像放在导航项的右侧按钮上//AddimagetorightbarbuttoninnavigationbarUIBarButtonItem*rightBarButton=[[UIBarButtonItemalloc]initWithImage:[UIImageimageNamed:@"refresh.png"]style:UIBarButtonItemStyleBorderedtarget:selfaction:@selector(getData)];self.navigationItem.rightBarButtonItem=rightBarButton;[r

iphone - 视网膜兼容性问题 : Can I add @2x to my own images for retina compatibility?

如果我将@2x后缀附加到我自己的图像,iOS4会自动将我的图像替换为Retina兼容图像,还是仅适用于Apple定义的图像?(例如图标。) 最佳答案 当然可以。如果您在应用中显示myimage.png,您可以添加视网膜就绪myimage@2x.png,以便在视网膜设备上显示。参见thisguide了解更多信息。 关于iphone-视网膜兼容性问题:CanIadd@2xtomyownimagesforretinacompatibility?,我们在StackOverflow上找到一个类似的