我在 m 文件中添加了按钮和图像,一些按钮如何返回图像而不出现,我需要图像应该返回并且按钮应该在前面并且应该在点击时工作,以下代码:
UIImage *myImage=[UIImage imageNamed:@"bottom_bar.png"];
UIImageView *imageView =[[UIImageView alloc] initWithImage:myImage];
imageView.frame= CGRectMake(0, 0, 320, 32);
[footerView addSubview:imageView];
UIButton *profileButton = [UIButton buttonWithType:UIButtonTypeCustom];
CGRect profileRect = CGRectMake(215.0, 0,20, 20);
[profileButton setFrame:profileRect];
[profileButton addTarget:self action:@selector(profile:) forControlEvents:UIControlEventTouchUpInside];
UIImage *profileImage = [UIImage imageNamed:@"profile_icon.png"];
[profileButton setImage:profileImage forState:UIControlStateNormal];
[footerView addSubview:profileButton];