Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (IBAction) leyenda: (id)sender
- {
- fondo = [[UIControl alloc] initWithFrame: CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
- [fondo setBackgroundColor: [UIColor blackColor]];
- [fondo setAlpha: 0.5];
- [fondo addTarget: self action: @selector(cerrarLeyenda:) forControlEvents: UIControlEventTouchUpInside];
- [self.view addSubview: fondo];
- [self.view bringSubviewToFront: fondo];
- leyend = [[UIView alloc] initWithFrame: CGRectMake(60, 70, 200, 300)];
- [leyend setBackgroundColor: [UIColor whiteColor]];
- int yPosition2 = 0;
- UILabel *cabecera = [[UILabel alloc] initWithFrame: CGRectMake(0, yPosition2, leyend.frame.size.width, 30)];
- [cabecera setBackgroundColor: [UIColor colorWithRed: 255.0/255.0 green: 204.0/255.0 blue: 0.0/255.0 alpha: 1]];
- [cabecera setText: @"Leyenda"];
- [cabecera setTextAlignment: UITextAlignmentCenter];
- [leyend addSubview: cabecera];
- yPosition2 += cabecera.frame.size.height + 10;
- UIImageView *iconoEvento = [[UIImageView alloc] initWithFrame: CGRectMake(10, yPosition2, 40, 40)];
- [iconoEvento setImage: [UIImage imageNamed: @"evento_icono_verde.png"]];
- [leyend addSubview: iconoEvento];
- UILabel *iconoEventoTxt = [[UILabel alloc] initWithFrame: CGRectMake(50, yPosition2, leyend.frame.size.width - 100, 0)];
- [iconoEventoTxt setText: @"Botón de acceso al evento"];
- [iconoEventoTxt setBackgroundColor: [UIColor clearColor]];
- [leyend addSubview: iconoEventoTxt];
- yPosition2 += iconoEvento.frame.size.height + 5;
- UILabel *eventoDesc = [[UILabel alloc] initWithFrame: CGRectMake(10, yPosition2, leyend.frame.size.width - 20, 0)];
- [eventoDesc setText: @"Permite visualizar la información del evento y configurar sus rutas."];
- [eventoDesc setBackgroundColor: [UIColor clearColor]];
- [eventoDesc setNumberOfLines: 0];
- [eventoDesc sizeToFit];
- [leyend addSubview: eventoDesc];
- // Animación para la aparición de la leyenda
- [UIView beginAnimations: @"flipping view" context: nil];
- [UIView setAnimationDuration: 0.5];
- [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
- [self.view addSubview: leyend];
- [UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView: leyend cache: YES];
- [UIView commitAnimations];
- [self.view bringSubviewToFront: leyend];
- }
Advertisement
Add Comment
Please, Sign In to add comment