iPhone SDK: непрозрачные подпредставления в прозрачном виде

У меня есть подпредставление, которое было добавлено в мой UIView. Идея заключается в том, что подпредставление представляет собой зависшую панель с uibuttons. Подпредставлению присваивается альфа 0,2, поскольку пользователь должен видеть, что за этим стоит.

Проблема в том, что когда я добавляю uibutton в подпредставление, они наследуют альфа от подпредставления (я хочу, чтобы кнопки были непрозрачными и имели альфа 1.0). Я'мы пытались решить эту проблему, перебирая uibuttons и устанавливая их альфа обратно в 1.0 безуспешно. Решения?

    // Create the subview and add it to the view
    topHoverView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
    topHoverView.backgroundColor = [UIColor blackColor];
    [topHoverView setAlpha:0.2];
    [self.view addSubview:topHoverView];

    // 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;
    }

Ответы на вопрос(2)

Ваш ответ на вопрос