Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should create topHoverView with alpha 1.0 and a transparent background color. Then add a subview with a black background that covers the complete view with alpha 0.2 and then add the buttons to topHoverView:</p> <pre><code>// Create the subview and add it to the view topHoverView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)]; topHoverView.backgroundColor = [UIColor transparentColor]; [topHoverView setAlpha:1.0]; [self.view addSubview:topHoverView]; canvasView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)]; canvasView.backgroundColor = [UIColor blackColor]; [canvasViewView setAlpha:0.2]; [topHoverView.view addSubview:canvasView]; // Add button 1 button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button1 setFrame:CGRectMake(20, 10, 80, 30)]; [button1 setTitle:@"New" forState:UIControlStateNormal]; [button1 addTarget:self action:@selector(button1Action:) forControlEvents:UIControlEventTouchUpInside]; [topHoverView addSubview:button1]; // Add button 2 button2 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button2 setFrame:CGRectMake(120, 10, 80, 30)]; [button2 setTitle:@"Clear" forState:UIControlStateNormal]; [button2 addTarget:self action:@selector(button2Action:) forControlEvents:UIControlEventTouchUpInside]; [topHoverView addSubview:button2]; // Add button 3 button3 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button3 setFrame:CGRectMake(220, 10, 80, 30)]; [button3 setTitle:@"Delete" forState:UIControlStateNormal]; [button3 addTarget:self action:@selector(button3Action:) forControlEvents:UIControlEventTouchUpInside]; [topHoverView addSubview:d button3]; // Attempt to iterate through the subviews (buttons) to set their transparency back to 1.0 for (UIView *subView in topHoverView.subviews) { subView.alpha = 1.0; } </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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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