Created
May 17, 2012 12:09
-
-
Save abrahamjso/2718485 to your computer and use it in GitHub Desktop.
Views iOS example2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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