使用视网膜,我们使用名称中的@ 2x制作图像.我看到默认图像必须是默认值-568h @ 2x,但其他图像似乎不是这种情况.就像我的背景是bg.png和bg@2x.png一样,我尝试使用bg-568h@2x.png,但这不起作用.有人可以告诉我需要命名的图像来支持iPhone 5吗?
我想为相同的信息自定义文本,但是当我在Facebook上分享它时,我不想使用twitter哈希标签或@username方案......
如何根据将使用哪种共享服务来分散文本以进行共享?
当然我正在使用UIActivityViewController:
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:@[shareText, shareURL] applicationActivities:nil];
Run Code Online (Sandbox Code Playgroud) 我最近开始与UIActivity合作,将我的应用程序分享给全世界,但我遇到的问题很少.首先,我没有找到如何设置我的电子邮件的主题.有什么办法吗?其次,当我设置电子邮件的正文时,会有一个额外的"输入"(电子邮件的第一行是空白,我的文本从第二行开始).这是代码:
NSMutableArray *array = [[NSMutableArray alloc] initWithObjects: @"Test", nil];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc]
initWithActivityItems:array applicationActivities:nil];
Run Code Online (Sandbox Code Playgroud)
在电子邮件中,它显示:
"
测试"
第三:有没有办法知道选择了哪种共享方法?因为我希望在用户在Twitter上分享时在我的帖子中包含一个标签,但现在它也被集成在电子邮件中,这显然没有意义.
谢谢!
我需要设置translatesAutoresizingMaskIntoConstraints为NO.默认情况下,它设置为YES(以协助大多数从struts和spring转换到新的Auto Layout的应用程序).
Xcode中有哪些地方可以将默认值更改YES为NO?
或者我是否必须为每个视图手动设置它?
根据Collection View编程指南,应该处理单元格高光的视觉状态UICollectionViewDelegate.像这样:
- (void)collectionView:(PSUICollectionView *)collectionView didHighlightItemAtIndexPath:(NSIndexPath *)indexPath
{
MYCollectionViewCell *cell = (MYCollectionViewCell*)[collectionView cellForItemAtIndexPath:indexPath];
[cell highlight];
}
- (void)collectionView:(UICollectionView *)collectionView didUnhighlightItemAtIndexPath:(NSIndexPath *)indexPath
{
MYCollectionViewCell *cell = (MYCollectionViewCell*)[collectionView cellForItemAtIndexPath:indexPath];
[cell unhighlight];
}
Run Code Online (Sandbox Code Playgroud)
我不喜欢这种方法的是它为委托添加了非常特定于单元格的逻辑.事实上,UICollectionViewCell通过highlighted财产独立管理其突出显示的状态.
那么,压倒一切setHighlighted:不是一个更清洁的解决方案吗?
- (void)setHighlighted:(BOOL)highlighted
{
[super setHighlighted:highlighted];
if (highlighted) {
[self highlight];
} else {
[self unhighlight];
}
}
Run Code Online (Sandbox Code Playgroud)
这种方法有没有缺点而不是委托方法?
我正在使用GCD异步下载我的uitableview的图像,但是有一个问题 - 当滚动图像时闪烁并且一直在变化.我尝试将每个单元格的图像设置为nil,但它没有多大帮助.快速向上滚动时,所有图像都是错误的.我该怎么办?这是我的细胞方法:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (self.loader.parsedData[indexPath.row] != nil)
{
cell.imageView.image = nil;
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
dispatch_async(queue, ^(void) {
NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:[self.loader.parsedData[indexPath.row] objectForKey:@"imageLR"]]];
UIImage* image = [[UIImage alloc] initWithData:imageData];
dispatch_async(dispatch_get_main_queue(), ^{
cell.imageView.image = image;
[cell setNeedsLayout];
});
});
cell.textLabel.text = [self.loader.parsedData[indexPath.row] objectForKey:@"id"];
}
return cell;
}
Run Code Online (Sandbox Code Playgroud) 我想要Facebook app native dialog login(https://developers.facebook.com/docs/technical-guides/iossdk/login/#fbnative).
在控制台中,单击FBLoginView时收到以下消息:
FBSDKLog: Cannot use the Facebook app or Safari to authorize, fb**** is not registered as a URL Scheme
Run Code Online (Sandbox Code Playgroud)
但我完全按照这里做的那样:将Facebook SDK更新为3.5后无法打开活动会话
我有一些自iOs 6以来被弃用的功能.也许这对于刚刚更新到iOs 6的其他人也会有所帮助.
[self presentModalViewController:pNewController animated:YES];
presentModalViewController:animated is deprecated since iOs 6
Autosynthesized property 'String' will use synthesized instance variable '_String', not existing instance variable 'String'
Autosynthesized property 'phonenumber' will use synthesized instance variable '_phonenumber', not existing instance variable 'phonenumber'
Deprecated: Group Table View Background Color is deprecated in iOS 6.0.
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮我修复它,所以在我的项目中不会有任何弃用的功能.
提前致谢
所以iOS6已经出局了,可怕.现在,似乎Apple已经删除了以前在Safari中存在的"开发者控制台".很好,我听到很多人说 - 它很有限.
但是,它适用于设备 - 现在显然你必须将设备连接到Mac才能获得网络检查员?
这是用控制台调试的唯一方法吗?有没有办法调试Windows,Safari?请注意,我并不仅仅意味着只更改用户代理,您可以在Safari Windows上执行 - 不注册触摸事件 - 只需单击即可.
我打算在我的一个项目中创建一个书架.基本要求如下:
UICollectionView是我遇到的第一个选项.它可以轻松支持网格单元.所以我用Google搜索并发现了一些非常有用的教程:
Bryan Hansen的UICollectionView自定义布局教程
Mark Pospesel的如何将装饰视图添加到UICollectionView
LXReorderableCollectionViewFlowLayout
结果如下:(请忽略颜色不一致问题,因为我选择的图形尚不完美.)

我做了什么:
但是我遇到了一些问题:
如果项目可以在一个屏幕上显示,我根本无法滚动
然后我添加了以下代码,以使contentize更大
- (CGSize)collectionViewContentSize
{
return CGSizeMake(self.collectionView.bounds.size.width, self.collectionView.bounds.size.height+100);
}
Run Code Online (Sandbox Code Playgroud)
然后我就可以滚动了.在这里,我拉下第一行:

您可以看到徽标的装饰视图正常工作.
但是当我拉出最后一排时,我遇到了第二组问题:

您可以看到绿色框部分未添加装饰视图.
当我重新订购商品时,书架栏有时会移动

我在这里列出了一些重要的代码:
- (void)prepareLayout
{
// call super so flow layout can do all the math for cells, headers, and footers
[super prepareLayout];
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
NSMutableDictionary *shelfLayoutInfo = [NSMutableDictionary dictionary];
// decoration view - emblem
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:0 inSection:0]; …Run Code Online (Sandbox Code Playgroud) ios6 ×10
ios ×5
xcode ×3
objective-c ×2
autolayout ×1
debugging ×1
deprecated ×1
email ×1
ipad ×1
iphone ×1
sharing ×1
uiactivity ×1
xcode4.5 ×1