Comments (11)
Got it, here:
self.navigationController?.view.addSubview(coachmark)
you are adding the coach mark as a subview of navigationController?.view
.
And here:
coachmark.translatesAutoresizingMaskIntoConstraints = false
coachmark.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
coachmark.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
coachmark.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
coachmark.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true
you are installing layout constraints between the coach mark and your view controller view
.
To fix your issue just set the constraints between coachmark
and navigationController?.view
by writing something like this:
coachmark.translatesAutoresizingMaskIntoConstraints = false
coachmark.leftAnchor.constraint(equalTo: navigationController!.view.leftAnchor).isActive = true
coachmark.topAnchor.constraint(equalTo: navigationController!.iew.topAnchor).isActive = true
coachmark.bottomAnchor.constraint(equalTo: navigationController!.view.bottomAnchor).isActive = true
coachmark.rightAnchor.constraint(equalTo: navigationController!.view.rightAnchor).isActive = true
from coachmarks.
Can you upload an example project having this issue?
from coachmarks.
Let me know if 56fce70 fixes the issue
from coachmarks.
Have you tried placing the coachmark
view inside the view
of your UINavigationController
's topViewController
?
from coachmarks.
Hi, im tried to present in topViewController and app dont crash anymore, awesome!
But im want to present coachmark in my NavigationBar too, like coachmarking my barbutton items...
Check this image on attach
My code:
self.navigationController?.topViewController?.view.addSubview(coachmark) coachmark.translatesAutoresizingMaskIntoConstraints = false coachmark.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true coachmark.topAnchor.constraint(equalTo: view.topAnchor).isActive = true coachmark.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true coachmark.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true
self.navigationItem.rightBarButtonItems = [self.btnBarSearch, self.btnBarFilter] coachmark.textLabel.textColor = .white coachmark.textLabel.text = "👋 this is a little example app showcasing some coach marks" coachmark.present(in: view, from: CGRect(x: self.btnBarFilter.buttonFrame().origin.x, y: 0, width: 40, height: 40), focusingOnElement: false)
Thanks bro
from coachmarks.
Ohh, its works very well!! Thank you!!
One more question here, I swear =D
Why are some white corners appearing? I already tried to change the background color and other things, but nothing stopped them from appearing. If I use in my navigationController.topView these same white corners do not appear!
Doesnt matter the position, look this
from coachmarks.
This is probably because the from: CGRect
param you're passing to coachmark.present(in:from:focusingOnElement:)
is too small.
Try adding some margin to it, try something like this:
coachmark.present(in: view, from: CGRect(x: self.btnBarFilter.buttonFrame().origin.x, y: 0, width: 40, height: 40).insetBy(dx: -5, dy: -5), focusingOnElement: false)
from coachmarks.
Doesnt matter my insetBy, the white walkers (AKA white corners) continues appearing
from coachmarks.
Yes, take a look
https://github.com/fabriciomasiero/CoachMarksExampleError
Please, use iPhone 6s, cause the present CGRect are with hand values
from coachmarks.
Ok, I guess that's a bug. I'll push a fix as soon as possible.
from coachmarks.
@pNre WORKS!!! Thanks bro!
from coachmarks.
Related Issues (3)
- Not presenting over UITabbar HOT 5
- Delegates Not Called HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coachmarks.