Image not showing on iPad

70 Views Asked by At

I have created an iOS APP for iPad and my application is using XIB. On XIB I have put a UIImageView and UIButtonview and set the image on both of them. The image is showing on XIB but when I am testing it on simulator then both of these views is not showing. I have checked hidden and alpha of both views.

I have debugged my source code and found that it may be because of Alpha. You can see the attached screenshot. I have not written any source code in my .m file, simply load the viewcontroller from xib But still it's Alfa is changing I don't how alfa is changing enter image description here

In my project ,I am also using following source code

/***** MyView.h************/

@interface UIImageView (MyView)

- (void) setAlpha:(float)alpha ;

@end

/***** MyView.M************/

@implementation UIImageView (MyView)

- (void) setAlpha:(float)alpha 

 //here alpha value is always zero but under xib it's value is 1
 //I Don't know why here I am getting zero

{

    [super setAlpha:alpha];

}

@end

I don't know why it is happening, can anyone please help me.

1

There are 1 best solutions below

0
hitesh landge On

I got the solution my self I need to use "CGFloat" at the place of "float"

/***** MyView.h************/

@interface UIImageView (MyView)

- (void) setAlpha:(CGFloat)alpha ;

@end

/***** MyView.M************/

@implementation UIImageView (MyView)

- (void) setAlpha:(CGFloat)alpha 
{

    [super setAlpha:alpha];

}

@end