I have an error but I have not found how to solve it as such but only how to cover the problem.
Log.e("APIComm:AssetsPropertyReader", e.toString());
It gives me the error
The log in tag can be at most 23 characters, was 26
I have an error but I have not found how to solve it as such but only how to cover the problem.
Log.e("APIComm:AssetsPropertyReader", e.toString());
It gives me the error
The log in tag can be at most 23 characters, was 26
I have developed an iOS app with Objective-C, but it is very heavy. What kinds of things can I do to reduce the size of my app?
In particular I want to improve in these two aspects:
How can I return to the previous view but when I return. example with arrows and dots:
I'm here
and I come back with[_controladorSuite.controladorDeNavegacion popToRootViewControllerAnimated:NO];
How do I get back from where I came back XD
----> or
or <- or
or -> or
hahahaha something like that is what I want to do
How can I see the components of a view inside another view How can I see the components of the main view:
NSArray *sub = [self.view subviews];
if ([sub count] == 0) return;
for (int i=0; i<sub.count; i++){
NSLog(@"Subview: %@", sub[i]);
}
And if it gives me the components that view has, but what happens if that view has another view inside with other subviews, how can I identify them, try:
NSArray *sub = [self.view subviews];
if ([sub count] == 0) return;
for (int i=0; i<sub.count; i++){
if ([sub[i] isKindOfClass:[UIView class]]) {
NSArray *sub1 = [sub[i] subviews];
for (int x=0; x<sub1.count; x++){
NSLog(@"ssssssss:::::::::::%@", sub1);
}
}
}
But it's not that it doesn't work, but it recognizes the buttons as SUBVIEW and it pulls the component that it has inside, let's say that if the button has an image it tells me that it has a UIImageview inside and if it has text a UIButtonLabel they explain what is happening and like getting only the ones that that UIView has at the moment, ONLY the UIView's.
This is my code.
NSArray *sub = [self.view subviews];
if ([sub count] == 0) return;
for (int i=0; i<sub.count; i++){
UIButton *boton = (UIButton *)sub[i];
//Convierto el boton a UIImage
UIGraphicsBeginImageContextWithOptions(boton.bounds.size, NO, 0.0);
[boton.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * imageOriginal = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
// crear un nuevo tamaño, es decir el tamaño de imagen redimensionado
CGSize sz = CGSizeMake(boton.frame.size.width, boton.frame.size.height);
// hacer el recorte final rec basado en los valores calculados
CGRect clipRect = CGRectMake(boton.frame.origin.x, boton.frame.origin.y, boton.frame.size.width, boton.frame.size.height);
// inicia un nuevo contexto, con el factor de escala 0.0 para que las pantallas retina obtengan una imagen de alta calidad
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
UIGraphicsBeginImageContextWithOptions(sz, NO, 0.0);
} else {
UIGraphicsBeginImageContext(sz);
}
//Modifica el trazado de recorte actual interceptándolo con el rectángulo especificado
UIRectClip(clipRect);
//Dibuja toda la imagen en el rectángulo especificado, escalándola según sea necesario para que se ajuste. Este método dibuja toda la imagen en el contexto gráfico actual, respetando el ajuste de orientación de la imagen. En el sistema de coordenadas por defecto, las imágenes se sitúan abajo ya la derecha del origen del rectángulo especificado. Sin embargo, este método respeta cualquier transformación aplicada al contexto gráfico actual.
[imageOriginal drawInRect:clipRect];
//Elimina el contexto de gráficos basado en mapas de bits actual de la parte superior de la pila
UIGraphicsEndImageContext();
[sub[i] setImage:imageOriginal];
NSLog(@"ImageButton: %@", boton);
}
Unfortunately there is a way to pass the image that I store in the UIImage to the UIIbutton
UIImageview
How can I get the name of the image that has an or UIButton
or assigned to it?UILabel