문제

The following IBAction will run when I don't have bookCoverUp.alpha = 0; in the code, but as soon as I add that code, and try running the program, the IBAction stops working completely.

-(IBAction)done:(id)sender
{
    bookCoverUp.alpha = 0;
    //this sends you to the desired viewcontroller
    SimpleTableView *newWindow = [self.storyboard
    instantiateViewControllerWithIdentifier:@"SimpleTableView"];
    [self.navigationController pushViewController:newWindow animated:YES];
}
도움이 되었습니까?

해결책

This is the expected behavior for invisible views.

From the Apple doc:

To hide a view visually, you can either set its hidden property to YES or change its alpha property to 0.0. A hidden view does not receive touch events from the system.

다른 팁

If you're looking to create a transparent button, change your button type to "Custom" (or in code, UIButtonTypeCustom) and don't give it a background colour or background image - it is transparent by default.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top