2013-08-05 1 views
0

내 프로젝트 중 하나에서 aviary sdk를 통합했습니다. presentmodalViewcontroller을 사용할 때 작동합니다. 그러나 addsubview 메서드를 사용하면 Editorcontroller에서 아무 버튼이나 클릭 할 때 충돌이 발생합니다.Aviary 충돌 문제를 Subview로 추가 할 때

enter image description here

AFPhotoEditorController *featherController = [[[AFPhotoEditorController alloc] initWithImage:image] autorelease]; 
[featherController setDelegate:self]; 
[featherController.view setBackgroundColor:[UIColor blackColor]]; 
featherController.view.frame = CGRectMake(0, 0, 512, 748); 
[self.view addSubview:featherController.view]; 
//[self presentModalViewController:featherController animated:YES]; 

내가 명확하지 않다 있으면 알려 주시기 바랍니다. 미리 감사드립니다.

답변

1
Import AFPhotoEditorController.h in AppDelegate. 

Set property to object of AFPhotoEditorController in AppDelegate.h 
@property (nonatomic,strong) AFPhotoEditorController *featherController; 

Then Declare two methods in AppDelegate.h 
-(void)fn_showAFPhotoEditorController; 
-(void)fn_removeAFPhotoEditorController; 

And synthesize it in AppDelegate.m 

@synthesize featherController=_featherController; 



-(void)fn_showAFPhotoEditorController{ 
    AFPhotoEditorController * obj1 =[[AFPhotoEditorController alloc]init]; 
    [self setfeatherController:obj1]; 

    [self.window addSubview:[_featherController view]]; 
    [self setNewViewToLandscape:[_featherController view]]; 

} 
-(void)fn_removeAFPhotoEditorController{ 
    [_featherController.view removeFromSuperview]; 

    _featherController=nil; 
} 


After that create an instance of AppDelegate wherever you want and just give a call to show view and remove it. 

AppDelegate *obj=(AppDelegate *)[[UIApplication sharedApplication] delegate]; 
[obj fn_showAFPhotoEditorController];////To Show view 

[obj fn_removeAFPhotoEditorController];////To Remove it.