I have a MKmapView in my application. now i want to add frame im my MKmapView. I have written the code as follows:
- (id)initWithFrame:(CGRect)frame
{
// Initialization code
time=[[UILabel alloc] initWithFrame:CGRectMake(10, 10, 200, 21)];
time.textColor=[UIColor blackColor];
[time setFont:[UIFont boldSystemFontOfSize:18]];
[time setBackgroundColor:[UIColor whiteColor]];
[time addSubview:time];
time.alpha=0.8;
return time;
}
but the frame does not appear in my MKmapView.
pls help me for this.
thanx in advance.
You just added time as a subView of itself, thats not going to do much. You want to add it as a subview of your MKMapView, or the view that MKMapView is on. If you add it after you add MKMapView it will appear over the MKMapView.
Hope this helps.