Friday, 3 February 2012

Arrowed Title View

Hi All,

I Found that in lot of application specifically in case of iPad with complex view design sometimes we use arrow to a specific location to pointing out the user what to do, most developers use image(arrowed image) for this purpose with a label over it. But I think if we use a subclass of UIView is less weight, so I go through the drawing tutorials and create my on view. I use it in my two different projects.

In this example code I attached herewith shows the arrow at bottom left corner, but any one can change the location very easily.

Now (while posting this blog), I think it is better to had the view in such a way that the arrow position is changeable from external interface, But now I don't have time so I will post another blog or update this blog later for this. (I mean I try to implement Arrowed title view with arrow can be at any location around the view like the UIPopover arrow setting).

See the screen Shots,

//To Display the Arrowed Title View named as NSArrowedTitleView
(Here prefix NS means not 'Next Step' it just 'Naveen Shan' my name, if you don't like change it.)

 -(void)showTitleView {  
   NSArrowedTitleView *objTitleView = [[NSArrowedTitleView alloc] initWithFrame:CGRectMake(0, 20, (self.view.frame.size.width), 40)];  
   objTitleView.viewColor = [UIColor grayColor];  
   objTitleView.viewTitle = @"NSArrowed Title View";  
   [objTitleView setNeedsDisplay];  
   [self.view addSubview:objTitleView];  
   [objTitleView release];  
   objTitleView = nil;  

2. call the above method like as follows,

 [self showTitleView];  

I attached complete code here

if you need more details feel free to contact me

Naveen Shan

No comments:

Post a Comment