Willkommen auf unserem Seminar-Blog

Immer auf dem aktuellen Stand bleiben

Dieser Seminar-Blog befindet sich noch im Aufbau und wird in den kommenden Tagen entsprechend verfeinert.

Member Login

Lost your password?

Registration is closed

Sorry, you are not allowed to register by yourself on this site!

You must either be invited by one of our team member or request an invitation by email at viad.info {at} zhdk {dot} ch.

Posts Tagged ‘Grid’

Basic ImageGrid

Freitag, Oktober 8th, 2010
Simple Example Grid: 1. Create ViewBasedApplication 2. Add -> NewFile -> Cocoa Touch Class -> Objective-C-Class(UIView) -> ExampleGrid 3. Open the already existing ExampleGridViewController.xib 4. Click on the View(In the list below Files'Owner and FirstResponder) -> Change the ClassIdentity to your Created ExampleGrid -Class 5. Add the following  example-function to the ExampleGrid-Class:
- (void)drawRect:(CGRect)rect {
  //image url
  UIImage *myImage = [UIImage imageWithData: [NSData dataWithContentsOfURL: [NSURL URLWithString: @"http://sammlungen-archive.zhdk.ch/media/thumbnails/19-0279.jpg"]]];
  for(int rowIndex = 0; rowIndex < 4; rowIndex++) {
    for(int colIndex = 0; colIndex < 6; colIndex++) {
      NSLog(@"currentColumn%",colIndex);
      UIImageView *myImageView = [[UIImageView alloc] initWithImage:myImage];
      CGRect frame = myImageView.frame;
      frame.origin.x = frame.size.width * colIndex;
      frame.origin.y = frame.size.height * rowIndex;
      myImageView.frame = frame;
      [self addSubview:myImageView];
      [myImageView release];
    }
  }
}
ref:  http://www.iphonedevsdk.com/forum/iphone-sdk-development/12858-generate-grid-images.html