我有UIView包含一个pin图像和一个标签,因为我们知道UIView是矩形所以如果我将UIView转换为UIImage,UIImage也是矩形,我想让UIImage像一个pin图像,因为如果用户点击背景,UIImage的事件将也被称为..我想在没有背景的情况下将UIView转换为UIImage,它怎么可能?
我使用此方法将UIView更改为UIImage
-(UIImage *) ChangeViewToImage : (UIView *) view{
UIGraphicsBeginImageContext(view.bounds.size);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
Run Code Online (Sandbox Code Playgroud)
嗯..像这样的例子,我有一个UIView的矩形和UIView中的三角形.然后我想让这个UIView成为一个UIImage,但我只想要没有背景的三角形,所以图像只是一个三角形..我怎么能这样做?
不使用API?
我知道有几种方法.
我顺便使用mshtml库,这比webbrowser控件更好.我正在有效地自动化Internet Explorer.
基本上我更喜欢直接拍摄图像,而不必知道htmlimg的URL并下载它.
我知道我可以从image元素中获取URL并使用webclient下载它.图像根据cookie和IP而变化.所以那不行.
我希望htmlimg元素显示的确切图像是存储的图像.
基本上好像有人正在拍摄屏幕上显示内容的本地屏幕截图.
好的,我将我的应用程序注册到Itunes connect.我确保可以使用正确的应用程序名称和包.
然后我完成了我的项目,然后我想验证.
然后我收到了这条消息.
什么是错的?
Apple无法找出具有相同bundle ID和相同应用程序名称的任何应用程序吗?哪一个不匹配?
exc_breakpoint(code = exc_i386_bpt,subcode = 0x0)
这是bug的截图:

额外奖励:如果有人可以告诉我如何"复制"错误信息,我们将不胜感激
在即时窗口中,日志显示:
2012-06-04 12:08:17.097 BadgerNew [866:17003]可达性标志状态:-R ----- l- networkStatusForFlags
项目周围的代码非常简单.我很惊讶我们有一个bug.
+(NSString *) Json_StringGetter:(NSString *) URL{
CM(@"Json string getter");
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:URL]];
DLog(@"request:%@",request);
PO(URL);
PO(request);
__block NSError *error=nil;
__block NSURLResponse *urlresponse=nil;
__block NSData *response = nil;
__block NSString *json_string=nil;
//[Tools computeTimeWithName:FUNC block:^{
response= [NSURLConnection sendSynchronousRequest:request returningResponse:&urlresponse error:&error];
json_string = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
//}];
if (error) {
DLog(@"error at jsonparser:%@",urlresponse);
DLog(@"error at jsonparser:%@",error);
DLog(@"I break points here");
}
return json_string;
}
Run Code Online (Sandbox Code Playgroud) -(NSString *) nibName
{
PO([self class]);
PO([super class]);
PO([self superclass]);
Run Code Online (Sandbox Code Playgroud)
只[self superclass]产生实际的超类.
[self class]: BGImageForBizs
[super class]: BGImageForBizs
[self superclass]: BGUIImageWithActivityIndicator
Run Code Online (Sandbox Code Playgroud) 断言失败 - [UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:]
我从IOS 7开始就遇到了这个错误.它在IOS 6中工作正常.
我环顾网络,发现了这个:
http://forums.xamarin.com/discussion/8233/ios-7-crash-in-collectionview
但是,解决方案没有意义
我想到了.我错误地使用了CollectionView.RegisterClassForCell.显然我应该在设置viewcontroller时使用CollectionView.RegisterNibForCell.这解决了问题.iOS 6必须更加宽容.
你能不能给我一个关于这个bug的提示
Symptomps:
我怀疑的代码是这样的:
- (CGSize)collectionView:(UICollectionView *)collectionView
layout:(UICollectionViewLayout*)collectionViewLayout
sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
CGSize sz = [BGCollectionViewCellImage defaultSize];
return sz;
}
Run Code Online (Sandbox Code Playgroud)
但它似乎太普通了.
sz只是100*120的CGSize
另一个是:
- (BGCollectionViewCellImage *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
BGCollectionViewCellImage * cell = [[BGCollectionViewCellImage alloc]init];
Image * img= self.arImages[indexPath.row];
[cell setImg:img andIndex:indexPath.row+1];
return cell;
}
Run Code Online (Sandbox Code Playgroud)
也许我应该使用像UITableViewCell那样的队列
我得到了另一个暗示.如果我试图将某些单元格出列,我得到了这个:
2013-10-14 21:18:34.346 domainname [24667:a0b] *由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'无法使类型的视图出列:标识为BGCollectionViewCellImage的UICollectionElementKindCell - 必须注册一个nib或类用于标识符或连接故事板中的原型单元'* First throw call stack :(
看起来我先注册了一些东西.
我遇到了isEqual的问题:
代码:
if (currentAnchor isEqual:currentBusiness.getCllLocation))
{
do a;
}
else
{
do b;
}
Run Code Online (Sandbox Code Playgroud)
currentanchor和currentbusiness.getCllocation是位置
但如果它们是相同的,为什么函数b被称为?我的代码有问题吗?
或者它必须是服务器端?
目前谷歌要求所有网站都是302到一个页面,而不是通常的页面.
我怎么用javascript这样做?我可以在元或其他东西中打印302代码吗?
注意:抱歉.这不是谷歌的搜索引擎.这是google饲料供应商bodis.com above.com namedrive.com和其他一些人.
我是域名派克.我获得了在搜索引擎排名的域名,并将流量转移到其他地方.问题是谷歌现在禁止URL转发.我只是想如何用更透明的转发来保持我的排名,例如302.目标网址很漂亮,我会说空白.
我喜欢iOS中的nsoperationqueue.什么是java中的等价物?
这是我目前的PHP程序:
$dateStamp = $_SERVER['REQUEST_TIME'];
Run Code Online (Sandbox Code Playgroud)
我后来记录.
结果是$dateStamp变量包含如下数字:
1385615749
这是一个Unix时间戳,但我希望它包含带有小时,分钟,秒,日期,月和年的人类可读日期.
所以我需要一个将其转换为人类可读日期的函数.
我该怎么办?
还有其他类似的问题但不完全像这样.我想要最简单的解决方案.
objective-c ×5
xcode ×4
cocoa-touch ×1
download ×1
ios ×1
iphone ×1
iphone-4 ×1
java ×1
javascript ×1
nsoperation ×1
php ×1
redirect ×1
timestamp ×1
uiimage ×1
uiview ×1
vb.net ×1
xcode5 ×1