我们有一个非常简单的带有两个背景图像的 UIButton,每当打开按钮时,按钮的左上角都会显示一个小矩形。仅当按钮为 UIButtonTypeRoundedRect 时才会出现此问题,如果我切换到 UIButtonTypeCustom 它工作正常。有人有线索吗?
UIButton *mainBtn=[UIButton buttonWithType:UIButtonTypeRoundedRect];
mainBtn.tag=0;
mainBtn.frame=CGRectMake(128, 8, 60.0, 60.0);
mainBtn.adjustsImageWhenHighlighted=NO;
[mainBtn setBackgroundImage:[UIImage imageNamed:@"main_tabBar_btn_main.png"] forState:UIControlStateNormal];
[mainBtn setBackgroundImage:[UIImage imageNamed:@"main_tabBar_btn_main_selected.png"] forState:UIControlStateSelected];
[tabBarView addSubview:mainBtn];
[mainBtn addTarget:self action:@selector(tabBarBtnTap:) forControlEvents:UIControlEventTouchUpInside];