如何更改未选中的UITabBarItem标题和背景图像iOS 8的tintColor?
未选择状态的默认颜色为浅灰色,但在我的暗色UITabBar背景上不显示
我希望我的未选择状态有[UIColor blackColor]的颜色
在我的应用程序委托内部完成了完成任务:我有
UIImage *deselectedE = [[UIImage imageNamed:@"mincraft_axe_green_32.png"] imageWithRenderingMode:UIImageRenderingModeAutomatic];
UIImage *selectedE = [[UIImage imageNamed:@"mincraft_axe_green_32.png"] imageWithRenderingMode:UIImageRenderingModeAutomatic];
e.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Profile" image:deselectedE selectedImage:selectedE];
[[UITabBar appearance] setTintColor:[UIColor blackColor]];
Run Code Online (Sandbox Code Playgroud) Swift 4.2出来了,我在使用ObjectMapper和其他一些pod 时在我的项目中收到了这条错误消息:
使用Swift 4.1.2编译的模块无法在Swift 4.1.50中导入
那么如何告诉Xcode开始更新我的项目并将其迁移到Swift 4.2?
我IBDesignable在swift中有自定义类,可以在Interface Builder中执行一些导致崩溃的事情.有没有我可以查看的标志,看看我是否在界面生成器中运行?理想情况下,它将是一个预编译器指令(#ifdef COMPILED_FOR_INTERFACE_BUILDER或类似的东西).我想也许我可以自己设置一个标志prepareForInterfaceBuilder()但是看起来很乱并且似乎没有可靠的工作,因为它看起来在调用该函数之前设置了类属性,这可能会触发导致问题的代码.似乎必须有更好的方法.谢谢!
获取以下Xcode 10GM版本内置警告
跳过代码签名,因为目标没有Info.plist文件.(在目标'FirebaseCore'中)
跳过代码签名,因为目标没有Info.plist文件.(在目标'FirebaseCore'中)
如何摆脱这些警告?
我正在尝试向我的应用添加推送通知.我需要知道如何显示推送通知弹出窗口.我所关注的弹出窗口是一个警报视图,有两个选项,"允许"和"不允许".它询问用户是否允许应用程序接收通知和内容.
我已经尝试一遍又一遍地删除我的应用程序并推进时间但没有任何效果.
此外,如果出现弹出窗口,我如何知道所选用户是否不允许/允许?
notifications push-notification apple-push-notifications ios
这是我的代码
extension UIImage {
convenience init(color: UIColor, size: CGSize = CGSizeMake(1, 1)) {
let rect = CGRectMake(0, 0, size.width, size.height)
UIGraphicsBeginImageContext(rect.size)
let context = UIGraphicsGetCurrentContext()
CGContextSetFillColorWithColor(context, color.CGColor)
CGContextFillRect(context, rect)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
init(CGImage: image.CGImage!)
}
}
Run Code Online (Sandbox Code Playgroud)
在init(CGImage: image.CGImage!),我得到错误
初始化程序只能在类型中声明
在一个特定场景中,我将用户带到密码设置页面.以下是用于此的代码 -
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=PASSCODE"]];
Run Code Online (Sandbox Code Playgroud)
升级到iOS 10测试版后,我不再使用设置密码页面而是终止应用程序.
任何人都可以帮我这个.提前致谢 .
我正在按照本教程使用swift在我的iOS应用中添加谷歌登录.我按照提到的所有步骤进行了操作,但是当我尝试构建应用程序时,它在我的appdelegate.swift文件中给了我一个问题.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
var configureError: NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
assert(configureError == nil, "Error configuring Google services: \(configureError)")
GIDSignIn.sharedInstance().clientID = "client id"
return true
}
Run Code Online (Sandbox Code Playgroud)
所以下面的代码行
GGLContext.sharedInstance().configureWithError(&configureError)
Run Code Online (Sandbox Code Playgroud)
错误文本是"使用未解析的标识符GGLContext".这可能是什么问题?
我的代码:
if let url = NSURL(string: "www.google.com") {
let safariViewController = SFSafariViewController(URL: url)
safariViewController.view.tintColor = UIColor.primaryOrangeColor()
presentViewController(safariViewController, animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)
这只在初始化时崩溃,只有异常:
指定的URL具有不受支持的方案.仅支持HTTP和HTTPS URL
当我使用时url = NSURL(string: "http://www.google.com"),一切都很好.我实际上是从API加载URL,因此,我无法确定它们是否会带有前缀http(s)://.
如何解决这个问题?我应该检查并http://始终加前缀,还是有解决方法?
ios ×10
swift ×4
xcode ×2
bartintcolor ×1
carthage ×1
cocoapods ×1
firebase ×1
google-login ×1
ibdesignable ×1
ios10 ×1
ios12 ×1
ios8 ×1
objective-c ×1
swift4.1.5 ×1
tintcolor ×1
uitabbaritem ×1
xcode10 ×1