Note that there are some explanatory texts on larger screens.

plurals
  1. POobjective c addSubview order
    primarykey
    data
    text
    <p>i am a junior programmer I face a problem of some of the subview in the program not shown , don't know if it is the addsubview order problem or the others . hope if anyone can provide a suggestion or solution .thanks all</p> <pre><code>for (int i = 0; i &lt; NUM_DISHES; i++) { UIImageView* img_steps = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"%d.jpg", i]]]; //IMPORTANT: The i*W_IPAD means that 1st 0*1024 , 1*1024 , 2*1024.............and so on [img_steps setFrame:CGRectMake(W_IPAD, 0, W_IPAD , H_UPFR)]; UIImageView* imageset = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[ary_img objectAtIndex:i]]]; [imageset setFrame:CGRectMake(89, 9, H_INGREPHOTO, W_INGREPHOTO)]; [ary_image addObject:imageset]; //ingredient amount section UILabel* lbl_amt = [[UILabel alloc] initWithFrame:CGRectMake(128, 177, 190, 33)]; [lbl_amt setText:[ary_amount objectAtIndex:i]]; [lbl_amt setFont:[UIFont systemFontOfSize:25]]; [lbl_amt setTextColor:[UIColor blackColor]]; [lbl_amt setBackgroundColor:[UIColor clearColor]]; [ary_amt addObject:lbl_amt]; //method section UILabel* lbl_method = [[UILabel alloc] initWithFrame:CGRectMake(596, 93, 130, 32)]; [lbl_method setText:[ary_meth objectAtIndex:i]]; [lbl_method setBackgroundColor:[UIColor clearColor]]; [lbl_method setFont:[UIFont systemFontOfSize:30]]; [lbl_method setTextColor:[UIColor blackColor]]; [ary_method addObject:lbl_method]; //alpha bar step number step number section UILabel* lbl_numberstep = [[UILabel alloc] initWithFrame:CGRectMake(90 + (130 * i), 5, W_NUMBERSTEP, H_NUMBERSTEP)]; [lbl_numberstep setText:[NSString stringWithFormat:@"%d",i + 1]]; [lbl_numberstep setFont:[UIFont systemFontOfSize:20]]; [lbl_numberstep setBackgroundColor:[UIColor clearColor]]; [lbl_numberstep setTextColor:[UIColor blackColor]]; [self.view addSubview:img_steps]; [alpha_bar addSubview:lbl_numberstep]; [alphaframe addSubview:[ary_method objectAtIndex:i]]; [alphaframe addSubview:[ary_amt objectAtIndex:i]]; [alphaframe addSubview:[ary_image objectAtIndex:i]]; } // Section --- Add Subview [self.view addSubview:background]; [background addSubview:main_view]; [main_view addSubview:alpha_bar]; [main_view addSubview:alphaframe]; [main_view addSubview:but_transit_to_a]; //can add to the main_view [main_view addSubview:left_buttom]; [main_view addSubview:right_buttom]; [alpha_bar addSubview:bar]; [alpha_bar addSubview:lbl_lastnum]; [alphaframe addSubview:but_transit_to_c]; } return self; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload