小编iCo*_*r86的帖子

计算两个CGPoints之间的距离

我需要计算两个CGPoints 之间的距离.我提到这个这个,但我不明白.

iphone box2d

26
推荐指数
6
解决办法
3万
查看次数

从ACTION_IMAGE_CAPTURE Intent获取图像路径

嗨我ACTION_IMAGE_CAPTURE用于捕获图像使用Intent如下:

Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(
MediaStore.EXTRA_OUTPUT, (new File(Environment.getExternalStorageDirectory(),
String.valueOf(System.currentTimeMillis()) + ".jpg"))
);
startActivityForResult(cameraIntent, 0);
Run Code Online (Sandbox Code Playgroud)

我需要将图像存储在SD卡中,并使用该onActivityResult方法检索该图像的路径.我不知道如何获取当前捕获图像的图像路径.

如果有人知道请帮助.

谢谢

camera android android-camera android-camera-intent

23
推荐指数
2
解决办法
4万
查看次数

在iPhone中裁剪图像的透明度

我正在研究Jigsaw类型的游戏,我有两个用于屏蔽的图像,我已经实现了这个代码用于屏蔽

- (UIImage*) maskImage:(UIImage *)image withMaskImage:(UIImage*)maskImage {

    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
    CGImageRef maskImageRef = [maskImage CGImage];

    CGContextRef mainViewContentContext = CGBitmapContextCreate (NULL, maskImage.size.width, maskImage.size.height, 8, 0, colorSpace, kCGImageAlphaPremultipliedLast);

    if (mainViewContentContext==NULL)
        return NULL;

    CGFloat ratio = 0;
    ratio = maskImage.size.width/ image.size.width;
    if(ratio * image.size.height < maskImage.size.height) {
        ratio = maskImage.size.height/ image.size.height;
    } 

    CGRect rect1 = {{0, 0}, {maskImage.size.width, maskImage.size.height}};
    CGRect rect2  = {{-((image.size.width*ratio)-maskImage.size.width)/2,-((image.size.height*ratio)-maskImage.size.height)/2},{image.size.width*ratio, image.size.height*ratio}};

    CGContextClipToMask(mainViewContentContext, rect1, maskImageRef);
    CGContextDrawImage(mainViewContentContext, rect2, image.CGImage);

    CGImageRef newImage = CGBitmapContextCreateImage(mainViewContentContext);
    CGContextRelease(mainViewContentContext);

    UIImage *theImage = [UIImage imageWithCGImage:newImage];
    CGImageRelease(newImage);
    return …
Run Code Online (Sandbox Code Playgroud)

iphone transparency uiimage

22
推荐指数
1
解决办法
4759
查看次数

如何从iphone中的uitextfield中选择文本?

我正在研究iPhone中的文本到语音应用程序,

其中有一个文本字段输入,我希望用户从文本字段中选择一部分文本,我的应用程序将所选文本转换为语音.

我的问题是我如何获得用户从文本字段中选择的文本?

iphone textfield ios

18
推荐指数
2
解决办法
1万
查看次数

隐藏或删除uitableview中的部分

我正在我的应用程序中实现一个分组表视图,用户可以从表的不同部分选择行.

我想根据第一部分行的选择隐藏(删除)特定部分(包括标题).

第一节标题是"你有车吗?",在行选择中答案是YES或NO.如果用户选择NO,则分组表中的第二和第三部分应隐藏(删除).

对于分组表中的无线电选择,我实现了这一点

我也提到这个,但没有完全满足我的需要.

请帮忙.

编辑

TableViewDelegates

myArray是我的数据源.myArrayAnswerCount包含每个部分的行数

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return [myArray count];
}

-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
    for (int i = 0; i<[myArray count]; i++) {
        if (section==i) {
            return [[myArray objectAtIndex:i] title];
        }
    }
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    for (int i = 0; i<[myArray count]; i++) {
        if (section==i) {
            return [[myArrayAnswerCount objectAtIndex:i] intValue];
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我如何从表中删除部分的代码,myIndexPath是NSIndexPath变量,它指向当前选中的部分.

[table beginUpdates];
[myArray removeObjectAtIndex:myIndexPath.section];
[table deleteSections:[NSIndexSet indexSetWithIndex:myIndexPath.section] withRowAnimation:YES];
[table endUpdates];
Run Code Online (Sandbox Code Playgroud)

iphone uitableview

6
推荐指数
1
解决办法
2万
查看次数

用EKEvent在iphone中播放闹钟

我正在使用EKEvent类来存储事件的应用程序,我希望我的应用程序在该事件发生时触发警报.我不知道如何在iPhone中播放闹钟.

alarm ios ekevent

5
推荐指数
1
解决办法
4679
查看次数

在Objective-C文件中从AppDelegate.swift访问UIWindow

我正在研究swift项目,我需要使用旧Objective-C代码.

我确实设法创建了-Bridge-Header.h文件,它对我有用.

现在在我的Objective-C代码,我需要参考UIWindowAppDelegate.swift,

以前任何人都可以这样做吗?

请指导我!

ios swift

4
推荐指数
1
解决办法
4161
查看次数

此证书由未知权限钥匙串签署

我不知不觉地删除了我的钥匙串系统证书,通常命名如下

Software Signing
com.apple.systemdefault
com.apple.kerberos.kdc
Apple Worldwide Developer Relations Certification Authority
Apple Code Signing Certification Authority
Run Code Online (Sandbox Code Playgroud)

现在,当我尝试为iOS开发创建开发人员证书并安装证书时,它给出了一个错误,上面写着"此证书由未知权限签名"

我不知道如何恢复它们.

我经历过这个

如果有人解决,请帮助.

macos keychain

3
推荐指数
1
解决办法
1万
查看次数

更改分段表中所选单元格的uitableviewcell颜色

我已经为每个部分分区了表格视图和检查选择(每个部分只允许单选,如单选按钮).

现在我想要做的是我想要改变用户选择的单元格的颜色(不是使用单元格的selectedBackgroundView属性动画的时间颜色变化的一小部分).

请帮忙.

谢谢.

iphone uitableview

2
推荐指数
2
解决办法
2万
查看次数