tags:

views:

11

answers:

0

Hello

I am hopeless, I´m trying do a View in Objetive - C.

I built the view, in Interface Builder with: View -> Scrool View -> Imagen View, two labels and a TextView.

I have a funtion: -(void)Configurar:(NSDictionary*)Configuraciones

This function set the position of components, the content text, the image, the size of the scroll view...

-(void)Configurar:(NSDictionary*)Configuraciones{

    int ImagenLargo;
int TextoLargo;

ImagenLargo = 0;
TextoLargo = 0;

NSString *CadenaImagen = [Configuraciones objectForKey:@"Imagen"];

int Longi=CadenaImagen.length;

CGRect frame = Etiqueta.frame;
//hemos tomado la etiqueta como referencia para los dos casos. Si no
if (Longi==0)   
{
    //Si no hay imagen la etiqueta ira arriba del todo
    frame.origin.y=0;
    Etiqueta.frame = frame;
}   
else
{
    //si si que hay etiqueta la imagen va arriba del todo y seguida la etiqueta
    [Imagen setImage:[UIImage imageNamed:CadenaImagen]];
    frame.origin.y=Imagen.image.size.height+1;
    Etiqueta.frame=frame;
}

frame = Linea.frame;
frame.origin.y=Etiqueta.frame.origin.y+Etiqueta.frame.size.height-25;
Linea.frame= frame;
frame = Texto.frame;
frame.origin.y=Linea.frame.origin.y+15;
Texto.frame = frame;

NSString *CadenaEtiqueta = [Configuraciones objectForKey:@"Etiqueta"];
Etiqueta.text = [NSString stringWithFormat:CadenaEtiqueta,Etiqueta.text];

NSString *CadenaTitulo = [Configuraciones objectForKey:@"Titulo"];
[self setTitle:CadenaTitulo];

NSString *CadenaCuerpoTexto = [Configuraciones objectForKey:@"CuerpoTexto"];
Texto.text = [NSString stringWithFormat:CadenaCuerpoTexto,Texto.text];

CGRect contentframe = Texto.frame;
contentframe.size.height = Texto.contentSize.height;
Texto.frame = contentframe;
//con esto marco al contenido del texto.


ImagenLargo=Texto.frame.origin.y;
TextoLargo=Texto.frame.size.height;

[BarraScrool setScrollEnabled:YES];
[BarraScrool setContentSize:CGSizeMake(320,ImagenLargo+TextoLargo+BarraInferior.frame.size.height)];

}

My problem is when the text.frame.origin.y is higher than 415, this does not appear.

I do not understand it... I am a new objetive C programmer, I am learning the lenguaje but I do not find the sense.

Thaksssss