好吧标题是自我解释.我想创建一个App,可以在App处于后台模式时管理编程的本地通知.通知工作顺利但我想在触发警报时触发自定义方法.
可能吗?谢谢.
这对你们所有人来说都是挑战......
我有一个UICollectionView
内部我的UIViewController
女巫正确加载.我也有一个定制UICollectionViewCell
类女巫包含一个UIButton
.
我NSArray
从我的服务器检索一些UIImage
对象,以便将一个背景图像分配给我的自定义按钮UICollectionViewCell
.
这是我的cellForItemAtIndexPath
功能代码:
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath;
{
UserPhotoCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"userPhotoCell" forIndexPath:indexPath];
if (indexPath.section == 0) {
[[cell imageButton] setBackgroundImage:[userPublicImages objectAtIndex:indexPath.row] forState:UIControlStateNormal];
} else {
[[cell imageButton] setBackgroundImage:[userPrivateImages objectAtIndex:indexPath.row] forState:UIControlStateNormal];
}
return cell;
}
Run Code Online (Sandbox Code Playgroud)
你可以看到很简单.
这有一个奇怪的行为:如果我把我的所有习惯都UICollectionViewCell
放在其中的一个部分UICollectionView
,那么性能还可以......
有任何想法吗?
一些额外的信息:UICollectionView
有标题.自定义标题.这只是一个UIView
机智UILabel
.
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
UICollectionReusableView *reusableView …
Run Code Online (Sandbox Code Playgroud)