ios - Change Alpha of a UIImage Programmatically -
i'm still exploring xcode/objective-c, , wondering how able alter alpha of uiimage. tried writing own code error 'property 'alpha' not found on object of type uiimage'. splash screen works if comment out alpha changing lines. code below.
// // viewcontroller.m #import "viewcontroller.h" @interface viewcontroller () @property (nonatomic,weak) iboutlet uiimage *logo; @end @implementation viewcontroller adbannerview *_bannerview; - (void)viewdidload { [super viewdidload]; [self.view addsubview:_bannerview]; [nstimer scheduledtimerwithtimeinterval:2.0 target:self selector:@selector(showlogo:) userinfo:nil repeats:no]; } - (void)showlogo:(nstimer *) timer{ [uiview animatewithduration:2.0 animations:^{ self.logo.alpha = 1.0; } completion:^(bool finished){ [uiview animatewithduration:2.0 animations:^{ self.logo.alpha = 0.0; } completion:^(bool finished){ viewcontroller *controller = [self.storyboard instantiateviewcontrollerwithidentifier:@"menu"]; [self.navigationcontroller pushviewcontroller:controller animated:yes]; }]; }]; } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } @end //thank you!
you need alter alpha of uiimageview contained in, there no alpha property uiimage.
ios objective-c xcode uiimage splash-screen
No comments:
Post a Comment