I was wondering if there is a possibility to fire the tapOnCalloutAccessoryControl method for a marker in code? For instance, I have list of all the markers, and when a user clicks a marker in the list, I zoom to that location, but I would love to get the callout to popup. Is this possible? Thank you.
Getting the callout to pop is different from the accessory control. The latter is the (typically chevron-image) control in the callout once it is popped up, the "go to more detail" button, basically.
To get a callout to popup, check out -[RMMapView selectAnnotation:] and friends.
Related
On this site : mecanomedic.com, the menu template work fine in "normal" desktop browser, but dont slide down on ipad-iphone device. What can be the problem ?
Some tell me it's a css problem, but HOW safari desktop work ?
The problem is that the menu expansion relies on the user hovering with a mouse. On touch devices like iPads & iPhones, the hovering gesture can't be replicated because there's only one input- touch. If I were you, I'd take a look at Twitter's Bootstrap menu setup and perhaps use media queries to serve up a different menu on smaller screen sizes.
Here's an example of a Bootstrap navigation bar in action (you'll have to inspect the code to see how it works).
Add a href to the top-level <a>'s so that they can be focusable:
Produits
Elements that are focusable receive mouse events and hover styles when the user taps on them.
As #Matt stated, the problem is that your menu relies on a hover event and unfortunately that event is unavailable on touch screen devices.
One way to fix this would be to:
Check if the current user's device is an iOS device
If the device is an iOS device, use javascript to trigger a menu item's "show event" when the menu button is CLICKED instead of ROLLED OVER / HOVERED.
This would result in the menu being shown when the user taps a menu button.
I want to have a button that says "WARN" and when the user pushes the button a pin will drop down on his location. But I can't figure out how to do that. It must be possible to halve multiple pins at the map, so the last annotation dropped doesn't diseppear when a new user presses the "WARN" button. Can somebody help me with this code please?
You should check out this example from Apple's documentation:
http://developer.apple.com/library/ios/#samplecode/MapCallouts/Introduction/Intro.html#//apple_ref/doc/uid/DTS40009746
I am a beginner in Titanium Studio. I can able to hide the keyboard when a button is selected. It works,
okBtn.addEventListener("click", function(e) { textField.blur(); });
But, how can I hide the keyboard when I tap/click on the mapView? I tried this code, Doesn't work,
mapview.addEventListener("click", function(e) { textField.blur(); });
mapview.addEventListener("singletap", function(e) { textField.blur(); });
So, how can I make it work? Thanks in advance.
The MapView only supports click events on annotations. That is why the click event is not firing in your use case.
(Note: The following JIRA ticket will clear up the documentation so that this is apparent: http://jira.appcelerator.org/browse/TIMOB-4777 )
To be able to hide the keyboard when the user wants to interact with the map, you need to get a bit creative. Overlay a transparent view on the map view when the text field is focused, and hide it whenever the text field is blurred or the overlay is touched.
Does that make sense? It's a bit of a hack, to be sure, and I imagine it might be a bit disconcerting for your users. If you can explain the desired UX a bit more, I can probably provide a more desirable solution.
I am having download icon on my page i want that when the user takes his finger over the button a tooltip should show as showing download in text.
is there any option in iphone to show a tooltip???
Dan is absolutely right on how to do it but I'd answer you should rethink your design to not need the tooltip at all.
There's a reason that there isn't one by default - what if the user presses down on the button to see what it does, reads the tooltip and realises that's not what they want. They then have to be very careful not to let go while still over the button or it will press and do the wrong thing. (And most users don't know that they can press down over a button, move their finger off it and release it to cancel the press.)
You should rethink your design to make it obvious what the buttons do without the user having to interact with them first.
However, if you definitely still want a tooltip, Dan's method is fine.
Nothing built-in, no. If you think about it, generally a tooltip appears when you mouse over the target item. There's no "mousing over" with a touch interface.
You can definitely roll your own, though. Start by placing a view containing your tooltip contents exactly where you want it with an alpha of 0%. Make a custom button with no content that outlines your download icon, and hook its "touch down inside" action to a method that animates the tooltip view to an alpha of 100%. Hook your button's "touch up inside" , "touch down outside" and "touch up outside" actions (and maybe some others--you might want to experiment with that) to a method that animates the tooltip view back to an alpha of 0%.
There isn't native support for this in iOS. But you can create your own.
I ended up creating my custom tooltip/popover class.
Can be initalised with any content view and dynamically adjusts it's frame.
Hope it helps.
https://github.com/akeara/AKETooltip
i would like to create a UIButton it will zoom in when mouse over it,can anyone tell me which event can do this
There is no mouse, only touches. How can you hover over a button without tapping it on a touch based interface? I dont think it works the way you think it does.
Hop into interface builder. Drop in a button and look in the attribute window.
You'll see the section that has Title: Image: Background. If you click on the drop down that says 'ALL', you can select several button states and set them accordingly. Use the highlighted state for when the user presses down on the button.
This should get you to understand how it works. You can dig into the docs to find out how to do it programaticaly from there.
Hover on the iPhone is a touch. Unless you're tracking where the finger is and you want objects to react when you enter their bounds. But the highlighted state should get you there.