如何为这个特定的设置设置背景图片? iOS10 和 XCode8.1?
我尝试了以下所有内容:
UINavigationBar.appearance().setBackgroundImage(UIImage(named: "navigationBg")!.resizableImage(withCapInsets: UIEdgeInsetsMake(0, 0, 0, 0), resizingMode: .stretch), for: .default)
UINavigationBar.appearance().setBackgroundImage(UIImage(named: "navigationBg")! , for: .any, barMetrics: .default)
UINavigationBar.appearance().setBackgroundImage(UIImage(named: "navigationBg")! , for: .default)
我可以使用 storyboard 设置 navigationBar 的颜色,但无法设置图像。
最佳答案
尝试设置“self.navigationItem.titleView”属性
引用:how-to-put-an-image-as-the-navigation-bar-title
更新:
试试这个,而不是在 UINavigationBar() 中设置
let navBackgroundImage:UIImage! = UIImage(named: "<navigationBarImage>")
self.navigationController?.navigationBar.setBackgroundImage(navBackgroundImage,
for: .default)
关于ios - NavigationBar 背景图片适用于 iOS 10 XCode 8.1 Swift 3.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40829692/
我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121
当我使用has_one时,它工作得很好,但在has_many上却不行。在这里您可以看到object_id不同,因为它运行了另一个SQL来再次获取它。ruby-1.9.2-p290:001>e=Employee.create(name:'rafael',active:false)ruby-1.9.2-p290:002>b=Badge.create(number:1,employee:e)ruby-1.9.2-p290:003>a=Address.create(street:"123MarketSt",city:"SanDiego",employee:e)ruby-1.9.2-p290
我找遍了所有我能找到的地方,但似乎找不到解决这个问题的办法。我在Lion10.8.2上使用Xcode4.5.1,并尝试为Rails项目运行bundle,但它一直卡在这上面。我正在为Heroku使用Thingem。Bolanos@Jeremys-Mac-mini⦿-1.9.3fishfarm$sudogeminstalleventmachinePassword:Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingeventmachine:ERROR:Failedtobuildgemnativeextens
EC2会在实例停止然后重新启动时为其提供新的IP地址,因此我需要能够自动管理route53记录集,以便我可以一致地访问内容。遗憾的是,sdk的route53部分的文档远不如ec2的文档那么健壮(可以理解),所以我有点卡住了。到目前为止,从我所看到的情况来看,似乎change_resource_record_sets(link)是可行的方法,但我对:chages需要什么感到困惑>因为它提到了一个Change对象,但没有提供指向所述对象描述的链接。这是我的代码目前的样子:r53.client.change_resource_record_sets(:hosted_zone_id=>'MY_
Asitcurrentlystands,thisquestionisnotagoodfitforourQ&Aformat.Weexpectanswerstobesupportedbyfacts,references,orexpertise,butthisquestionwilllikelysolicitdebate,arguments,polling,orextendeddiscussion.Ifyoufeelthatthisquestioncanbeimprovedandpossiblyreopened,visitthehelpcenter提供指导。11年前关闭。我是一位精通HTML
我们正在开发一个需要推送通知的WP8应用程序。为了测试它,我们使用CURL命令行运行推送通知POST请求,确保它实际连接,使用客户端SSL证书进行身份验证并发送正确的数据。我们确实知道,当我们收到对设备的推送时,这项工作是有效的。这是我们一直用于测试目的的CURL命令:curl--certclient_cert.pem-v-H"Content-Type:text/xml"-H"X-WindowsPhone-Target:Toast"-H"X-NotificationClass:2"-XPOST-d"MytitleMysubtitle"https://db3.notify.live.ne
我有一个适用于Rails中的Mongoid对象的作用域,它在开发时效果很好,但在运行测试时效果不佳。它实际上在测试中根本不起作用。这是一个嵌入式文档。父级:classPersonincludeMongoid::Documentdefself.with_appointmentswhere(:appointments.not=>{'$size'=>0})endembeds_many:appointments,store_as:'Appointments',class_name:'Appointment'end嵌入的child:classAppointmentincludeMongoid::
一些我找到的选项是ActiveCouchCouchRESTCouchPotatoRelaxDBcouch_foo我更喜欢GitHub上的项目,因为这让我更容易fork和推送修复。所有这些都符合该要求。我习惯了Rails,所以我喜欢像ActiveRecord模型一样工作的东西。另一方面,我也不希望我和Couch之间太多--毕竟我使用它作为我的数据库是有原因的。最后,它们似乎都得到了相当积极的维护(couch_foo可能是个异常(exception))。所以我想这归结为(不可否认和不幸的)主观:有没有人对他们有过好的或坏的经历? 最佳答案
根据YAML文档,可以传递hashofoptions到.to_yaml方法。目前,当我按照文档中的建议传递选项时,它不起作用,哈希被忽略。irb(main):001:0>require'yaml'=>trueirb(main):002:0>user={"1"=>{"name"=>"john","age"=>44}}user.to_yaml=>"---\n\"1\":\nname:john\nage:44\n"现在,传递一些选项:irb(main):014:0>user.to_yaml(:Indent=>4,:UseHeader=>true,:UseVersion=>true)=>"--
这段代码:deffunc*;end[func"hello"]在Ruby1.8.7中解析没有错误,但返回语法错误:syntaxerror,unexpected']',expecting'}'在Ruby中>=1.9。我浏览了WhatisthedifferencebetweenRuby1.8andRuby1.9,但找不到对此的引用。有谁知道是什么变化导致了这种情况? 最佳答案 这是为了避免歧义。请考虑以下事项:deffoo(a,b=1)#footakesanoptionalsecondargumentend[foo1,2]这可以解释为[(