IPhone picture gallery source code

后端 未结 2 1282
梦谈多话
梦谈多话 2021-02-04 22:59

HI all can anyone please refer me, the iphone image gallery source code? Any link ,sample code will be great help.

i am trying to show some 70 to 100 images as thumbn

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-04 23:18

    Hats off to this code. This works perfectly. Although I have modified the "appdelegate part" since I was using story boards.

    Here is what I did

    -(void)imageClicked:(id)sender{
         UIButton* button = (UIButton*)sender;
         imageNumber =  button.tag;
         [self performSegueWithIdentifier:@"loadImage" sender:sender];
    
    
    -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
     if ([segue.identifier isEqualToString:@"loadImage"])
     {
    
        [segue.destinationViewController setimageValue:imageNumber];
     }
    }
    

    And in my destination View Controller.m file named 'ImageViewController' I implemented things as below

     -(void)setimageValue:(int)number;
     {
         self.imageValue = number;
     }
    

    And in viewDidLoad, instead of app delegate I just used

        [self.scrollView scrollRectToVisible:CGRectMake(320*self.imageValue, 0, 320 , 440)          animated:NO];
    

提交回复
热议问题