Customize the background of Tab Bar in iPhone SDK

Customize the background of Tab Bar in iPhone SDK

In iPhone application, you can change the background of tab bar by an image by following this code:

// customize the tab bar background
CGRect frame = CGRectMake(0, 0, 480, 49);
UIView *viewBackround = [[UIView alloc] initWithFrame:frame];
UIImage *imgBackground = [UIImage imageNamed:@"bg_tabbarview.png"];
UIColor *colorPattern = [[UIColor alloc] initWithPatternImage:imgBackground];
viewBackround.backgroundColor = colorPattern;
[colorPattern release];
[[self.tabBarController tabBar] insertSubview:viewBackround atIndex:0];
[viewBackround release];
// end custom tab bar

 

Read More

How to open xls file in iphone application?

How to open xls file in iphone application?

You can follow theres step to view a XLS file in iPhone application:

1. Add a local xls file in to your project

2. Drag and drop an UIWebView control on the view.

3. Connect Files owner and UIWebView Object

4. In voidDidLoad(), add:

    //Get the path where your local xls file is located
    NSString *filepath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"xls"];
    //Now To use a local resource file in a web view you need to use NSURL fileURLWithPath:
    NSURL *url=[NSURL fileURLWithPath:filepath];
    //URL Requst Object
    NSURLRequest *requestObj=[NSURLRequest requestWithURL:url];
    //Load the request in the UIWebView.
    [preview loadRequest:requestObj];

Build and Go to see ;

Read More