Recargando la vista cuando la fila cambió en el objetivo de vista de tabla c

I have done markup code for different images. When the image changes, the markup and button still remain on screen. only it changes when i make a new markup on it.

The below image shows the button and markup of beach image.

Por favor, ayúdame...

enter image description here

preguntado el 28 de mayo de 14 a las 12:05

Try call setNeedsDisplay on the view where you placed the markup (after you remove it) this should force UIView to redraw itself. -

@Greg i have called [self setNeedDisplay] method but its not working... I am calling tableview function in one class and these markup and button in other class -

Show the code where you add and remove the markup and buttons. -

@Greg the code which i have used is working fine like i am getting markup count and removing the button. only thing is in displaying -

1 Respuestas

You might be using viewController.view instead of inhering UIView.

So now you can call a viewcontroller's instance method on didSelectRowAtIndexPath event, which will clear all the widgets from the existing view.

- (void)clearSubviewsFromContainerView
{
   for(UIView *view in [containerView subviews])
   {
       [view removeFromSuperview];
   }

   [self createNewWidgets];
}

Then call another method to generate and load new widgets.

- (void)createNewWidgets 
{
   // add new buttons, images over here in the same container view
}

Hope this might help you out.

contestado el 28 de mayo de 14 a las 14:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.