小编vir*_*wal的帖子

'支持的方向与应用程序没有共同的方向,并且应该返回'是'

*我的观点是在陆地景观模式我正在保存图像,我希望该图像回来,我的代码在下面,我发现错误"终止应用程序由于未捕获的异常'UIApplicationInvalidInterfaceOrientation',原因:'支持的方向没有共同的方向与应用程序,并且shouldAutorotate返回YES'"*我能为iPhone做什么?

        `- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {

         [self dismissModalViewControllerAnimated:YES];
         [picker release];

              }
             - (void)imagePickerController:(UIImagePickerController *)picker 

                didFinishPickingMediaWithInfo:(NSDictionary *)info {

            [picker dismissModalViewControllerAnimated:NO];

                imageDoodle.image = [info objectForKey:@"UIImagePickerControllerMediaMetadata"];

                 }

               -(IBAction)loadfromalbumclicked:(id)sender

                 {

                UIImagePickerController * picker = [[UIImagePickerController alloc] init];

                picker.delegate = self;

                 picker.allowsEditing=NO;

        picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;

               // self.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;

              [self presentModalViewController:picker animated:YES];
               }

              -(IBAction)savePrint{
//Save image to iOS Photo Library

                 UIImageWriteToSavedPhotosAlbum(imageDoodle.image, nil, nil, nil);
//Create message to explain image is saved to Photos app library
                 UIAlertView *savedAlert = [[UIAlertView alloc] initWithTitle:@"Saved"  

                message:@"Your picture has been saved …
Run Code Online (Sandbox Code Playgroud)

iphone cocoa-touch objective-c ios5 ios6

15
推荐指数
3
解决办法
3万
查看次数

如何在iOS中使uiscrollview无限?

我想像那样滚动1 2 3 1 2 3

我有一些按钮假设10我想在无尽的卷轴上显示.

 numbercolors=[[NSMutableArray alloc] init];

 //total count of array is  49 

 numbercolors = [NSMutableArray arrayWithObjects:@"25",@"26",@"27",@"28",@"29",@"31",@"32",@"33",@"34",@"35", @"0",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29",@"30",@"31",@"32",@"33",@"34",@"35", @"0",@"1",@"2",@"3",nil];

  int x=2500;

for (NSInteger index = 0; index < [numbercolors count]; index++)
{
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];

    button.frame = CGRectMake(x ,0,29.0,77.0);

    button.tag = index;

    [button setTitle:[numbercolors objectAtIndex:index] forState:UIControlStateNormal];

    [button addTarget:self action:@selector(didTapButton:) 

    forControlEvents:UIControlEventTouchUpInside];

    [coloringScroll addSubview:button];

    x=x+70+29;
}
 [coloringScroll setContentSize:CGSizeMake(5000+ (29+70)*[numbercolors count], 1)];

 [coloringScroll setContentOffset:CGPointMake(2500+(29+70)*11, 0)];
Run Code Online (Sandbox Code Playgroud)

这是我在scrollview上制作butttons的代码.

如何设置 - (void)scrollViewDidEndDecelerating :( UIScrollView*)发送方此方法进行无限滚动.

iphone objective-c uiscrollview ipad ios7

14
推荐指数
2
解决办法
2万
查看次数

如何在绘图中实现撤消功能,以便用户可以清除他的最后一行

我正在使用CoreGraphics实现免费的手绘,这对我来说很好,现在我想为这个绘图实现撤消功能,以便用户可以清除他的最后一次

iphone objective-c ios5 ios6

3
推荐指数
1
解决办法
171
查看次数

编译器如何知道按下了按钮?

我想知道编译器用来知道发生的事件的步骤,或者算法算法?例如,它如何知道已按下按钮?

compiler-construction xcode ios

1
推荐指数
2
解决办法
133
查看次数