Tag: ios7

UIPageControl不遵守它在UIScrollView中的约束

我有一个UIScrollView,在我的滚动视图中有很多视图。 我使用的是自动布局,所有的视图都以相同的方式布局:左和顶间距超级视图,宽度和高度设置。 一切都很好滚动,但是我的页面控制保持不变。 它不滚动滚动视图内的其他元素。 是的,我没有像其他元素一样检查页面控件是否在滚动视图中,是的,我已经四次检查了页面控件的约束条件。 它只是不会滚动。 可能是什么问题呢? 有标签,另一个滚动视图,文本视图,图像视图和他们都完全滚动,这只是页面视图是有问题的。 有Xcode / iOS SDK的错误,还是我错过了什么? 更新:我的滚动视图内的所有视图都在容器视图内。 滚动视图和容器视图的translatesAutoresizingMaskIntoConstraints属性都设置为NO 。 只有页面控件不服从它的限制。 以下是Interface Builder的屏幕截图:

将所有SKSpriteNode子项合并成一个SKSpriteNode

我怎样才能把一个SKSpriteNode和它的所有子SKSpriteNode并合并到一个没有子节点的单个平坦的SKSpriteNode? 谢谢。

UIModalTransitionStylePartialCurl不适用于iOS 8

我有与iOS7和以下版本绝对正常的代码。 但与Xcode6和iOS8 UIModalTransitionStylePartialCurl不起作用。 出现在第二卷的页面curl消失。 MyViewController* opts = [[MyViewController alloc] initWithView:someView]; opts.modalPresentationStyle = UIModalPresentationFullScreen; opts.modalTransitionStyle = UIModalTransitionStylePartialCurl; [self presentViewController:opts animated:YES completion:nil]; [编辑] – 我发现,如果构build完成xCode5.1并在iOS8上运行,按预期工作。 xCode6和iOS8有什么问题?

当hidesBottomBarWhenPushed仅在iOS7上设置为YES时,UITabBarController子视图消失

我做了一个UITabBarController的子类,在选项卡顶部添加一个自定义UIView,以replaceUITabBarItem上的默认标记。 我在自定义的UITabBarController的viewDidLoad上添加了这些自定义的badgeviews。 [self.view addSubview:_tabBarItem1BadgeView]; 我的自定义tabBarBadgeView上的drawRect如下所示: – (void)drawRect:(CGRect)rect{ CGContextRef ctx = UIGraphicsGetCurrentContext(); // Badge CGSize size = self.frame.size; CGSize badgeSize = [self sizeThatFits:size]; badgeSize.height = fminf(badgeSize.height, size.height); CGFloat x = roundf((size.width – badgeSize.width) / 2.0f); CGRect badgeRect = CGRectMake(x, roundf((size.height – badgeSize.height) / 2.0f), badgeSize.width, badgeSize.height); CGContextAddEllipseInRect(ctx, rect); CGContextSetFillColor(ctx, CGColorGetComponents([_badgeColor CGColor])); CGContextFillPath(ctx); [_textLabel drawTextInRect:badgeRect]; } 很好用。 […]

UIViewanimation不适用于iOS 7

我正在一个示例项目中,我有一个垂直scrollview和一个水平scrollview 。 垂直scrollview视图有一些子视图。 在scrollviewDidScroll我正在执行一些操作。 除此之外,我现在想要在屏幕上看到特定的子视图时,为垂直滚动视图内的子视图设置animation。 为此,我正在做一个确定的计算。 animation如下: 子视图包含多个自定义视图。 我试图animation(减less,然后再次增加视图的alpha值)在某些特定的时间序列(以便animation看起来顺序)这些视图中的每一个。 为此我张贴通知的意见和animation的顺序和逻辑是完美的,根据我想要的。 但是我面临的问题是代码正在执行时,我把断点,但animation不显示。 如果我停止滚动后发布通知,则animation发生完全正常。 但我想要的是animation即使在滚动和视图在屏幕上时也会发生。 我正在添加我的代码片段如下: SubView :(在我的scrollview ) – (void)animateSequenceTemplate { if (!hasSequenceTemplateAnimated) { [self performSelector:@selector(animateSequenceSlides) withObject:nil afterDelay:0]; hasSequenceTemplateAnimated = YES; } else { return; } } – (void)animateSequenceSlides { NSDictionary *userInfo = [NSDictionary dictionaryWithObject:imageAsset forKey:@"assetMO"]; [[NSNotificationCenter defaultCenter]postNotificationName:AnimateSequenceSlide object:nil userInfo:userInfo]; } 上述子视图中的子视图: – (void)animateSlideView:(NSNotification *)notification { […]

调暗UITableViewCell上的tintColor

这是一个UITableViewCell,打开一个模式('添加成分'): 我将标签颜色设置为匹配应用程序的tintColor: cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil]; cell.textLabel.text = @"Add Ingredients…"; cell.textLabel.textColor = [self.view tintColor]; 如何在显示UIAlertView或UIActionSheet时调暗文字颜色? 此行为是button和其他控件的默认值,但不是单元格的文本标签。 我发现了tintAdjustmentMode和tintColorDidChange的引用,但不知道如何使用。 或者我应该添加一个button到我的手机? 我以前使用这种方法的经验并不是最佳 – 有响应的副作用。

ios在导航控制器之间传递数据

我的应用程序有点问题,下面是这些视图控制器: 我有位置视图控制器的位置数组,我有一个位置数组在菜单表视图控制器,我需要传递数组从地点到菜单表,但我不知道如何,有人可以帮助我吗? 我已经尝试下面的代码: -(void)pushMenuTableView { UIStoryboard *storyboard = self.storyboard; UINavigationController *menuTableController = (UINavigationController *)[storyboard instantiateViewControllerWithIdentifier:@"MenuTableViewController"]; MenuTableViewController *menuController = (MenuTableViewController *) menuTableController.topViewController; [self.navigationController pushViewController:menuTableController animated:YES]; } – (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { MenuTableViewController *mvc = [[MenuTableViewController alloc]init]; NSIndexPath *path = [self.tableView indexPathForSelectedRow]; Location *selectedLocation = [_locations objectAtIndex:[path row]]; [mvc setLocation:selectedLocation]; [self pushMenuTableView]; }

崩溃:严重失败:LastResort字体在ios7中不可用

Iam将地址簿中的联系人插入到sqlite3数据库中。 只有一些联系我的应用程序正在崩溃 sqlite3_finalize(statement) 这个说法。 这是发生在ios7。 崩溃日志如下 “严重失败:LastResort字体不可用。在ios中” NSString *insertSQL = [NSString stringWithFormat:@"insert into vcards (some thing data)",(something data)]; const char *insert_stmt = [insertSQL UTF8String]; sqlite3_prepare_v2(database, insert_stmt,-1, &statement, NULL); if (sqlite3_step(statement) == SQLITE_DONE) { NSLog(@"Record inserted"); } else { NSLog(@"Record inserted failed"); } sqlite3_finalize(statement); sqlite3_close(database); 请任何一个build议我如何解决这个崩溃。

如何使.xib文件兼容iOS7,iOS6和更早版本

我在我的应用程序中使用.xib文件,我正在使用xcode5。 如果我在iOS6和更早版本中运行我的应用程序,则缺lessalignment。 任何人都知道这个问题? 我们是否需要为iOS7和iOS6创build单独的.xib文件? 编辑:我closuresAutolayout,但在iOS6下,意见仍然下降了20个像素。

项目工作背后的Uipickerview

我在我的视图控制器pickerview 。 我显示它通过添加到子视图,然后更改子视图的框架。 当我的pickerview显示我有一个button后面。 当我点击这些区域后,仍然显示button动作调用pickerview 。 如何设置pickerview正确?