I had found this post on the site for adding UIImage to the MKMapView but this is in the objective-c. can any body help how can we use it on the monotouch by c# ?
https://stackoverflow.com/a/6554418
I recommand you to view this screencast from Xamarin about "Developing iOS Map Applications with C#".
It doesn't cover the custom MKOverlayView drawing part because it's exactly as creating a custom view and overriding it's drawing routine.
But it does explain you how and why you have to endup here..
Basically, you have to
create a custom MKImageOverlay object (subclassing MKOverlay)
create a custom MKImageOverlayView object (subclassing MKOverlayView) that will handle the actual image drawing methods (like any view drawing overriding using CoreGraphics)
add your custom MKImageOverlay to the map with MKMapView.addOverlay() method
provide a MKMapViewDelegate to the map that will handle your custom MKImageOverlay by overriding GetViewForOverlay and returning your custom MKImageOverlayView
You could look at this SO post here too : MonoTouch Mapkit image overlay
Cheers
Related
I am trying to implement a custom control to have a reusable component that can be used in several view controllers. I followed this tutorial from Xamarin:
custom controls
unfortunately the control does not show up in IOS Designer's toolbox. How can i make it showing up?
I'll answer my own question:
The problem was that i needed to add a constructor like this:
public YourControlClass(IntPtr p)
: base(p)
{
...
}
I want to build my layout using storyboards but also use the implementation of Material. But I have trouble to understand how to use the NavigationBarViewController with Storyboards.
Can you create an example for Storyboard using the NavigationBarViewController with transition between views? Is it possible to use segues?
Your question is a little vague, but yes, you can segue (and usually do in any complex app) between views while contained in a navigation controller. The navigation controller will persist between these views unless you are segueing using modals.
I am following a code only approach for my Xamarin iOS app and can see how you can easily create control such as UILabel and UITextField in ViewDidLoad of a Controller. That is also where I can apply MVVMCross Fluent Binding.
I have seen Stuart's n19 where he creates a custom Circle View and one that creates a Custom Label.
The custom circle overrides the Draw method and draws a circle (Owner Draw)
The custom labels changes the Forecolor of the existing Label (Subclassed)
I don't feel that either of those works for me. I want to create a UIView that is made up of other controls, a composite control. Imagine a control that looked something like this. That would be an ImageView, and 4 labels with one of them clickable.
At what point in the life of the UIView would I create something like that. Is there an equivalent of ViewDidLoad?
As Stuart said in his comment, N=32 - ViewModels and MvxView on the iPad - N+1 days of MvvmCross
is the MVVMCross tutorial you want.
For those that are happy with the idea of ViewModels being more than just a ViewModel per screen and understand Binding the bit around Custom Views starts at minute 20
I need to create a Custom view in android which will have dynamic text like price, address etc. and also an ImageView inside it as shown in the image below. I tried to find google some tutorial for custom view but didn't find something satisfactory to do all these things. I also need to use onClick event on this view. Please guys, some code would be of great help. I'm a novice to android. I read google tutorial to create custom view but couldn't implement this.
https://lh4.ggpht.com/HmwmRTx3g9ddkHbgvZXpZOB3Am-O9OQARQ2qpxJ16zTDZbG57CmvgxUC75sGFzC3cqrH
Thanks for attention.
This is called Custom Overlay for MapView.
You can check example and implement as per your requirement - Android MapView Balloons
You can use FrameLayouts. It is very simple to use. FrameLayout can add several views on top of each other. It creates a stack of the views. Just add whatever views you want to inside FrameLayout and use the property setVisibility() to control when to show which view.
I'd like to display a UIWebView within a CCLayer for a Cocos2d 2.x project. I found the CCUIViewWrapper, but didn't get it to work with 2.x.
I don't really care about handling rotation and animation. I just wan't to display content from a web page on layer and also have a sprite to be able to go back to the previous scene.
Please help!
// Johan
If you don't want to use new version 2.0 features (I'm not using them myself at this point), then you can mix UIViews with Cocos by simply adding other views to your root view controller. After all, Cocos is itself a single view on the controller (if that's how you have it set up), and just add another view.
You can then easily tell the view controller to show the other UIViews by using the NSNotificationCenter, which I recommend in general over trying to communicate with the view controller from the Cocos layer.