Skip to content

Instantly share code, notes, and snippets.

@thedangler
Created March 9, 2012 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thedangler/2008785 to your computer and use it in GitHub Desktop.
Save thedangler/2008785 to your computer and use it in GitHub Desktop.
self.miniViewContainer.contentSize = CGSizeMake(self.view.frame.size.width -100 , top+200);
CGRect frame = CGRectMake(left, top, 250.0, 350.0);
CGRect buttonFrame = CGRectMake(0.0,210.0,200,0);
CGRect labelFrame = CGRectMake(0.0, 150.0, 200.0, 50.0);
UIView *miniView = [[UIView alloc] initWithFrame:frame];
miniView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
miniView.autoresizesSubviews = YES;
UIButton *emailBtn = [[UIButton alloc] initWithFrame:buttonFrame];
[emailBtn setTitle: @"Email" forState:UIControlStateNormal];
[emailBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
[emailBtn addTarget:self action:@selector(loadEmailView:) forControlEvents:UIControlEventTouchUpInside];
UILabel *img_title = [[UILabel alloc] initWithFrame:labelFrame];
img_title.adjustsFontSizeToFitWidth = NO;
img_title.textAlignment = UITextAlignmentCenter;
img_title.lineBreakMode = UILineBreakModeWordWrap;
img_title.numberOfLines = 0;
img_title.text = [fileName stringByReplacingOccurrencesOfString:@"_" withString:@" "];
//NSLog(@"image %@",img_path);
UIImage *theImage = [[UIImage alloc] initWithContentsOfFile:img_path];
UIButton *imgButton = [[UIButton alloc] initWithFrame:CGRectMake(0.0,0.0,200.0,150.0)];
imgButton.tag = i;
[imgButton setBackgroundImage:theImage forState:UIControlStateNormal];
[imgButton addTarget:self action:@selector(playMovie:) forControlEvents:UIControlEventTouchUpInside];
[miniView addSubview:imgButton];
[miniView addSubview:img_title];
[miniView addSubview:emailBtn];
[self.miniViewContainer insertSubview:miniView atIndex:0];
[imgButton release];
[img_title release];
[theImage release];
[emailBtn release];
[miniView release];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment