*我的观点是在陆地景观模式我正在保存图像,我希望该图像回来,我的代码在下面,我发现错误"终止应用程序由于未捕获的异常'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) 我想像那样滚动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*)发送方此方法进行无限滚动.
我正在使用CoreGraphics实现免费的手绘,这对我来说很好,现在我想为这个绘图实现撤消功能,以便用户可以清除他的最后一次
我想知道编译器用来知道发生的事件的步骤,或者算法算法?例如,它如何知道已按下按钮?
iphone ×3
objective-c ×3
ios5 ×2
ios6 ×2
cocoa-touch ×1
ios ×1
ios7 ×1
ipad ×1
uiscrollview ×1
xcode ×1