iOS - UIButton does not appear on UIView -
this tweak supposed cover lockscreen view (which happen) , add "ios" button view (which not). here's code:
#import <uikit/uikit.h> #import <springboard/springboard.h> @interface themos -(void)unlock; @end %hook springboard -(void)applicationdidfinishlaunching:(id)application { %orig; uibutton *button = [[uibutton alloc] initwithframe:cgrectmake(10,10,80,30)]; [button addtarget:self action:@selector(unlock:) forcontrolevents:uicontroleventtouchupinside]; [button settitle:@"ios" forstate: uicontrolstatenormal]; uiwindow* window = [uiapplication sharedapplication].keywindow; uiview *polygonview = [[uiview alloc] initwithframe: cgrectmake ( 0, 0, 640, 960)]; polygonview.backgroundcolor = [uicolor redcolor]; [window addsubview:polygonview]; [polygonview addsubview:button]; [window makekeyandvisible]; [polygonview release]; [button release]; } %new(v@:) -(void)unlock { [self unlockwithsound:yes]; } %end
thanks in advance! :)
add subviews window after window visible .
add subviews after line of code it'l appear.
[window makekeyandvisible]; -(void)applicationdidfinishlaunching:(id)application { %orig; uibutton *button = [[uibutton alloc] initwithframe:cgrectmake(10,10,80,30)]; [button addtarget:self action:@selector(unlock:) forcontrolevents:uicontroleventtouchupinside]; [button settitle:@"ios" forstate: uicontrolstatenormal]; uiwindow* window = [uiapplication sharedapplication].keywindow; [window makekeyandvisible]; uiview *polygonview = [[uiview alloc] initwithframe: cgrectmake ( 0, 0, 640, 960)]; polygonview.backgroundcolor = [uicolor redcolor]; [window addsubview:polygonview]; [polygonview addsubview:button]; [polygonview release]; [button release]; }
Comments
Post a Comment