Skip to content

Instantly share code, notes, and snippets.

@abrahamjso
Created May 17, 2012 12:09
Show Gist options
  • Save abrahamjso/2718485 to your computer and use it in GitHub Desktop.
Save abrahamjso/2718485 to your computer and use it in GitHub Desktop.
Views iOS example2
NSString *nombre = @"Creacion de un label"; //Creamos un string donde sera el nombre del contenido de nuestro label
UILabel *lnombre = [[UILabel alloc] initWithFrame:CGRectMake(20, 0, 500, 100)]; //Inicializamos nuestro label
//Nosotros le damos las medidas y la posicion con CGRectMake(margenX, margenY, tamanoX, tamanoY)
lnombre.backgroundColor = [UIColor clearColor]; //nuestro label tendra un fondo sin color
lnombre.font = [lnombre.font fontWithSize:25]; //Podemos dar el tamno de la letre e inclusive el tipo, en este caso su tamano es 25
lnombre.text = [NSString stringWithFormat:@"%@", nombre]; //Le agregamos el contenido que habiamos guardado
[ventanaFondo addSubview:lnombre]; //Agregamos nuestro label a la vista ventanaFondo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment