在我的应用程序中,我有 7 个按钮,按下向下箭头后,我在该视图中显示 3 个按钮,它显示其他 3 个按钮
1.Facebook 分享 2.twitter 分享 3.告诉朋友 4.报告 5.入门指南 6.访问我的网站 7.反馈
LIKE THIS MY VIEW
====================
^ ---->up arrow
facebook share
Twitter share
Tell a friend
V ---->down arrow
我正在使用 mailcomposerview 作为“告诉朋友”按钮和“报告”按钮
当我按下“告诉朋友”或“报告”按钮时,它会在关闭后打开 mailcomposerview,我无法移动向上和向下箭头......如果我按下向上和向下箭头,它会打开相同的邮件 composerview ,它也没有打开 facebook 分享和 twitter 分享
请帮我解决这个问题
按下箭头时我的编码
-(void)arrTapped1:(id)sender
{
CCMenuItem *item2=(CCMenuItem*)sender;
int k=item2.tag;
////CCLOG(@"k tapp=%dhelp=%d",k,helpVal);
NSLog(@"HelpVal%i",helpVal);
if(k==51)
{
if(helpVal<3)
{
id action1=[CCMoveBy actionWithDuration:0.3 position:ccp(0,+260)];
id callfun1=[CCCallFunc actionWithTarget:self selector:@selector(enabled1) ];
[item2 setIsEnabled:YES];
[(CCSprite*)[self getChildByTag:10] runAction:[CCSequence actions:action1,callfun1,nil]];
[self performSelector:@selector(downWardsMove)];
}
}
else //if(k==50)
{
if(helpVal>1)
{
id action1=[CCMoveBy actionWithDuration:0.3 position:ccp(0,-260)];
id callfun1=[CCCallFunc actionWithTarget:self selector:@selector(enabled1) ];
[item2 setIsEnabled:YES];
[(CCSprite*)[self getChildByTag:10] runAction:[CCSequence actions:action1,callfun1,nil]];
[self performSelector:@selector(upWardsMove)];
} } }
//code for upwards & downwards move
//--------------------------------
-(void)upWardsMove
{
[upArrItem setIsEnabled:NO];
[downArrItem setIsEnabled:NO];
self.isTouchEnabled=NO;
helpVal--;
[(CCMenu*)[self getChildByTag:53] setVisible:YES];
[downArrItem setIsEnabled:YES];
if(helpVal==1)
{
[(CCMenu*)[self getChildByTag:52] setVisible:NO];
[upArrItem setIsEnabled:NO];
}
}
-(void)downWardsMove
{
[upArrItem setIsEnabled:NO];
[downArrItem setIsEnabled:NO];
self.isTouchEnabled=NO;
helpVal++;
[(CCMenu*)[self getChildByTag:52] setVisible:YES];
[upArrItem setIsEnabled:YES];
if(helpVal==3){
[(CCMenu*)[self getChildByTag:53] setVisible:NO];
[downArrItem setIsEnabled:NO];
}
}
-(void)enabled1
{
self.isTouchEnabled=YES;
[upArrItem setIsEnabled:YES];
[downArrItem setIsEnabled:YES];
if(helpVal==3)
{
[(CCMenu*)[self getChildByTag:53] setVisible:NO];
[downArrItem setIsEnabled:NO];
}
if(helpVal==1)
{
[(CCMenu*)[self getChildByTag:52] setVisible:NO];
[upArrItem setIsEnabled:NO];
}
}
//sending mail code
//------------------
-(void)sendMail
{
mailComposer = [[UIViewController alloc] init];
[[[CCDirector sharedDirector] openGLView] addSubview:mailComposer.view];
MFMailComposeViewController *mailController= [[MFMailComposeViewController alloc] init];
mailController.mailComposeDelegate = self;
[mailController setSubject:msgSubject];
[mailController setMessageBody:mailContent isHTML:YES];
NSArray *toRecipients = [NSArray arrayWithObject:@"Info@ask.com"];
[mailController setBccRecipients:toRecipients];
[mailComposer presentModalViewController:mailController animated:NO];
mailComposer.view.transform = CGAffineTransformMakeRotation( CC_DEGREES_TO_RADIANS(90.0f ) );
[mailController release];
[[CCDirector sharedDirector] setDeviceOrientation: kCCDeviceOrientationLandscapeRight]
}
-(void)mailComposeController:(MFMailComposeViewController*)mailController didFinishWithResult: (MFMailComposeResult)result error:(NSError*)error
{
[mailComposer dismissModalViewControllerAnimated:YES];
}