Tag: ios7

AFNetworking 2.0和HTTP基本authentication

在AFNetworking 2.0上找不到AFHTTPClient,使用: AFHTTPClient *client = [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:@"http://examplewebsite.com]]; [client setAuthorizationHeaderWithUsername:@"username" password:@"password"]; 如何在AFNetworking 2.0上pipe理?

使用drawInRectalignment文本:withAttributes:

在我的应用程序的iOS 5版本中,我有: [self.text drawInRect: stringRect withFont: [UIFont fontWithName: @"Courier" size: kCellFontSize] lineBreakMode: NSLineBreakByTruncatingTail alignment: NSTextAlignmentRight]; 我正在升级iOS 7.上面的方法已被弃用。 我现在使用drawInRect:withAttributes:。 attributes参数是一个NSDictionary对象。 我可以得到drawInRect:withAttributes:使用这个工作原字体参数: UIFont *font = [UIFont fontWithName: @"Courier" size: kCellFontSize]; NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: font, NSFontAttributeName, nil]; [self.text drawInRect: stringRect withAttributes: dictionary]; 什么键值对我添加到字典获得NSLineBreakByTruncatingTail和NSTextAlignmentRight ?

UITabBar不显示在iOS 7中选定的项目图像

这些图标在ios 6中显示正常,但在ios 7中显示不了。我在viewController的viewDidLoad方法中设置了选中的状态。 当用户select一个标签栏项目图像消失。 这是我的代码: UITabBar *tabBar = self.tabBarController.tabBar; if ([UITabBar instancesRespondToSelector:@selector(setSelectedImageTintColor:)]) { [self.tabBarController.tabBar setSelectedImageTintColor:[UIColor whiteColor]]; } UITabBarItem *item0 = [tabBar.items objectAtIndex:0]; UITabBarItem *item1 = [tabBar.items objectAtIndex:1]; UITabBarItem *item2 = [tabBar.items objectAtIndex:2]; UITabBarItem *item3 = [tabBar.items objectAtIndex:3]; [item0 setTitle:@"Home"]; [item1 setTitle:@"Calendar"]; [item2 setTitle:@"News"]; [item3 setTitle:@"My Events"]; [item0 setFinishedSelectedImage:[UIImage imageNamed:@"homeIconSelected.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"home2.png"]]; [item1 setFinishedSelectedImage:[UIImage imageNamed:@"Calendar"] withFinishedUnselectedImage:[UIImage […]

在Xcode6中定位iOS7.1或7.0时,黑条出现在应用程序中

重现步骤: 使用Xcode6创build一个新项目(单视图模板,仅iPhone,Objective-C) 导航到项目设置并将部署目标从8.0更改为7.1 在安装了7.1的iPhone5 / S上或在iPhone5 / s 7.1模拟器上运行应用程序(您可能需要下载iOS7.1模拟器) 应用程序的顶部和底部出现黑条。 如果在iPhone5 / S 8.0模拟器上运行应用程序,屏幕将按预期显示,全白。 为什么发生这种情况? 有没有修复或解决方法?

更改UISearchBar上的光标颜色而不更改tintColor

我想我的searchBar的色调是白色的(这意味着取消button是白色的)。 当色调为白色时,光标不可见。 有没有办法分别设置光标颜色?

错误ITMS-90032:“无效的图像path – 没有find在关键'CFBundleIcons'下引用的path的图像:AppIcon40x40”

我得到这个“ 没有find在关键的'CFBundleIcons'下引用的path图像: ”错误, 即使我已经在Images.xcastes文件夹中添加应用图标图像,同时将我的应用上传到appstore。 你的直接反应是赞赏。 谢谢

UIActionSheet在iOS 7 GM的最后一个项目上没有显示分隔符

这可能是iOS7上的一个错误。 但是最后一个button并没有与前一个button分开 正如你可以从图像中看到的。 这在使用iOS7 GM的模拟器和设备上都会发生。 其他人是否也有同样的问题? UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"First", @"Second", @"Third", @"Fourth", nil]; [actionSheet showInView:self.view]; 正如你所看到的代码很简单。 任何想法如何解决这个问题? 或者我可以使用一些第三方库来代替UIActionSheet?

embedded在自定义容器视图控制器中时,内容落在导航栏下方。

UPDATE 基于Tim的回答,我在每个视图控制器中都实现了以下function,这些控制器具有作为我自定义容器一部分的滚动视图(或子类): – (void)didMoveToParentViewController:(UIViewController *)parent { if (parent) { CGFloat top = parent.topLayoutGuide.length; CGFloat bottom = parent.bottomLayoutGuide.length; // this is the most important part here, because the first view controller added // never had the layout issue, it was always the second. if we applied these // edge insets to the first view controller, then […]

iOS7的导航栏button过度填充

我使用LeftBarItems和RightBarItems时遇到了过多的UIBarButtonItem填充/间距(请参阅下图)。 UIBarButtonItems上使用的图标不包含额外的填充。 所以我想知道是什么原因造成的?

Xcode:找不到设备支持文件

因为我试图从新更新的Xcode 8运行我的应用程序到运行iOS 7.1.2的我的iPhone 4 它抛出错误, 而且,这是我的Xcode版本, 有没有人遇到过这个问题? 等待你的build议!