custom MKAnnotationView - iphone

I have been trying to create a MKAnnotationView which has to display multiple line of text.
Some one has pointed me to do things said in the below url
How to add more details in MKAnnotation in iOS
But i am not sure how to attain it due to my small knowledge in iPhone programming..
i have searched for a long tme but no use ...
Looking for help...Please guide me ..

Just to clarify, and based on what you are saying, you want to customise the look of the CALLOUT bubble that shows title/subtitle, not the annotation view itself, is this correct?
In case you're not clear, the MKAnnotationView is basically the image/icon/button that you see on top of the map for a specific location. Once you tap on that image/icon, if enabled, a call out bubble will appear where you can set a view for the left hand side, title, subtitle and a view for the right hand side - is this what you are hoping to customise?
If that's the case, this is a non-trivial task and if you are new to iPhone development chances are this is going to take a long time for you to implement.
If you still want to have a look, here's a blog post that might be of interest to you... http://blog.asolutions.com/2010/09/building-custom-map-annotation-callouts-part-1/

Here is another demonstration of customizing the callout bubble of an MKAnnotationView.

Related

Iphone : Custom MKAnnotationView Callouts

I just spent the last hour looking through stackoverflow and Google for examples on doing custom callouts. So not the actual pin that you click but the bit that appears above it.
What I want is to be able to put my own view above it. So JAKERI example does custom views but does not place them near the pin (so if anyone knows how to place a view above the pin that would work), Asynchrony Solutions blog example extends the bubble I believe and seems like a overkills
So, is there a simple way to place your own view about the map pin on click? I need to create quite a complete view with 5 lines, 3 images and a button
Try reading this. I've used it before and it did the trick for me.

view based iphone development question

I am trying to develop and app that will display a number or text and the user will physically speek the said number or text then touch the number or text and a new window will show another number or text
and this will continue many times
how should i go about developing this?
Brian, first of all you should take a look at UIViewController Class Reference:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html
This file will help you a lot, you'll know how to manage different view controllers, and it's basically what you need.
Second thing is: to touch the number or text it's OK, but to speak and your app recognize it, it's a little bit harder. I would suggest you to develop the touch control and after you finish with this, maybe you can start to study a way to develop the speakable control.
Third, as a basic model, you should think in instantiate an NSArray with the "right" content, I mean, the content that should be touched to go to next "step".
Create a button with this "right content" and for every touch in the screen you call a method to check if the touch was inside the right button or not.
You can use one UIViewController for each index of this array, or you can use always the same UIViewController and just change the words or numbers on the screen with some custom method.
Hope it helps.

iPhone - Proper UI controls for calculations

I am pretty new to iPhone development and currently working on an application which includes a view that performs a simple numerical calculation. In particular, the user enters 3 or 4 values into text fields and the view displays the result. Something along the lines of http://www.moneychimp.com/calculator/compound_interest_calculator.htm
What is the nicest way to achieve this? I am currently using simple UITextFields and a UILabel for the result but it doesn't look nice or "native-like". What UI object would be best to use?
Thank you!
It's entirely up to you. You're using the right classes for actual input- it comes down to how you choose to style those classes. I'd suggest looking at the documentation for UIView and CALayer (youView.layer, and include QuartzCore framework in your project).
A good start might be to choose a color scheme, a background for your app, and the look and feel you're shooting for- this will inform your styling. Try looking for apps that you think are elegant and attractive, and boil down what they do and what you like about them.
I'd say;
use a grouped table style (with the white tables with round corners on a blueish striped background)
embed settings values directly in the cell (aligned to the right) as much as possible
you can show a relevant keyboard (text, numbers) or picker view to let the user pick values, directly when they tap the cell. Use sliders and switches where relevant.
You may want to take a look at http://www.inappsettingskit.com/, we are currently investigating it for the same purpose and it seems to do the job
You can use either a UISlider or a UIPickerView if some of your values have limits.
You can use UISwitch for toggles.
You can also switch the default keyboard for your textfields to be numeric.
Other than that you seem to be on the right track.
Also, sometimes putting a view inside a scrollview makes things seem cooler even if its only one page. The auto bounce on scrollviews is kind of cool.

How can I use MKPinAnnotationView on top of a regular UIView (instead of on a map)

I'm writing an iPhone application that will contain a custom map -- my own image for the map, not Google's. The image isn't very large, so instead of using a library such as RouteMe, I'm opting for just a UIScrollView with an embedded image (the map).
My question is: it is possible to re-use Apple's MKPinAnnotationView classes on top of my custom UIView so that the pin interactions will feel the same as MapKit? I have so far figured out how to add a pin to my map and position it, but I can't figure out how to let the user interact with it -- i.e. make the description bubble pop up.
Any thoughts? Thanks very much.
You might be able to make one and use add subview in order to display it, ull prolly have to do some work to get it to display where u want it to since the coordinates u give are meant to work eith mkmaps
Have you looked at this method from MKAnnotationView:
(void)setSelected:(BOOL)selected animated:(BOOL)animated
It's the only method that is publicly exposed that may show/hide the callout bubble. Other than that, you'd have to reverse engineer the classes and start poking around.
However, I would highly recommend against reverse engineering the classes and using methods that aren't publicly exposed. Apple makes no promises on maintaining backwards compatibility and if they figure out that you are using private methods, they'll kick your app from the store.
btw, full disclosure, these are Apple's documentation notes for setSelected:animated:
Discussion
You should not call this method
directly. An MKMapView object calls
this method in response to user
interactions with the annotation.

iPhone: add badge to icons internal to my app

I am trying to add badges to the icons in my app. e.g. in the facebook app, in the home page the number of pending requests is shown on the requests icon.
Can someone provide any links/ideas on how to do this?
Thanks,
V
I know this article is a little bit old, but it helps me recently to make a little class to create custom badges. I thought it would be fair to make this class public for everyone. So here it is CustomBadge.
best regard
- Sascha
Lots of ways to do this. You can overlay a UILabel over the icon (which may be a UIView or UIImageView). YOu can put another view on top of the icon, and draw the text right into that view. Or make your icon view be a subclass of UIView, and when you get called to draw, you draw the icon and the number.
Plus, you may want to play with blend modes, shadow, masking, etc., in order to create something that is visually attractive.
I'd probably start with reading more about Quartz, if you haven't already. The rest is just how you wire it all up.
And some other links:
http://scientificninja.com/development/numeric-badges-on-the-iphone
http://th30z.netsons.org/2009/03/qt4-drawing-notification-badges/
alt text http://th30z.netsons.org/wp-content/uploads/qtdrawbadges.png
The Three20 project (its code is part of the Facebook app) has those badges.