ios - Custom UIView not visible on addSubview -


I have created a simple progressive class which I have to show when I'm working a bit longer. However, when I add it to the view of the parents, it never becomes visible and the layout is not made. The specialties are never called.

The class has been implemented as follows:

  @implementationProgressView @ synthesize title; Cancel @ synthesis; @Synthesis progression; @ Synthesis representative; - (id) initWithFrame: (CGRect) frame {// frame = CGRactam (0, 0, 240, 112); Self = [super initWithFrame: frame]; If (self) {from self.title = [[UILabel alloc] init]; Self.cancel = [UIButtonTypeCustom] with UI Button Button; Self.progress = [[UI Performance Allocation] IIT]; Self.backgroundColor = [UIColor darkGrayColor]; [Self add sublueview: sevettel]; [Self-edited review: self-canal]; [Self add sbewview: self Progress]; } Healthy return; } + (ID) Make Vitality: (NSSTING *) pTitle {ProgressView * PRT [[Progression light] initWithTitle: pTitle]; Return PRT; } - (id) initWithTitle: (NSString *) pTitle {self = [super initWithFrame: CGRectMake (0, 0, 240, 112)]; If (self) {self.title.text = pTitle; } Healthy return; } - (zero) layoutSubview {CGSize superFrameSize = self.superview.frame.size; CGSize halfSuperFrameSize = CGSizeMake (superfracrazie.width / 2, superfrauds.height / 2); CGSize FrameSies = self.frame.size; CGSize Half Frame Size = CGSizeMake (Frame Size with / 2, Frame Size. Hight / 2); // Window on your parents center [Self Setfram: CGRactMake (Half Swarf size.width - Aff. size.width, Half SaferFrame sizeHight - Half frame size; Lightweight, frame size width, frame size. High)]; [From self.title setframe: CGRactMake (4, 4, frame size, fourth-8, 24)]; [Self. Progress Setframe: CGRactack (4, 32, frame size, fourth-8, 24)]; [Self-Canal Setfram: CGRactack (4, 64, frame size, fourth-8, 44)]; [Self-setday display]; }  

and I follow the footage as follows:

  pProgressView = [[Progressive view] initWithTitle: @ "downloading ..."]; [Peugeot set set dialegate: Self]; [Self.view addSubview: pProgressView];  

but it does not show I have seen that the removal is definitely happening later and there is a lot of time for the scene to come. I'm at a loss though

Does anyone tell me, maybe most stupid, I'm making a mistake?

"post-text" itemprop = "text">

You do not need to call the named starter in the death, not [Super Init]:

 < Code> Self = [InitWithWith Frame: CGRactMake (0, 0, 240, 112)];  

Named initializer is one that calls the Superclass initiator, see for more information.


Comments