UIButton not showing in iOS
Following is a code to display a button to the toolbar.
<code>

    UIButton myButton = [UIButton buttonWithType:UIButtonTypeCustom];
    UIImage *myImage = [UIImage imageNamed:@"img1.png"];

    [myButton setBackgroundImage:myImage forState:UIControlStateNormal];
    UIBarButtonItem *myToolbarButton = [[UIBarButtonItem alloc] initWithCustomView:myButton];

</code>

Nothing gets displayed on the toolbar. Please tell me what is wrong.
UIButton not showing in iOS
===

Following is a code to display a button to the toolbar.
<code>

    UIButton myButton = [UIButton buttonWithType:UIButtonTypeCustom];
    UIImage *myImage = [UIImage imageNamed:@"img1.png"];

    [myButton setBackgroundImage:myImage forState:UIControlStateNormal];
    UIBarButtonItem *myToolbarButton = [[UIBarButtonItem alloc] initWithCustomView:myButton];

</code>

Nothing gets displayed on the toolbar. Please tell me what is wrong.