Tec*_*ain 10 iphone objective-c uibutton ipad ios
我想在左上角添加按钮UICollectionViewCell.我能够在单元格的左上角添加按钮,但它不会出现在单元格的顶部,而是出现在单元格下方.请告诉我该怎么做?
_deleteButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, delButtonSize, delButtonSize)];
_deleteButton.center = CGPointMake(9, 10);
_deleteButton.backgroundColor = [UIColor clearColor];
[_deleteButton setImage: [UIImage imageNamed:@"cross_30.png"] forState:UIControlStateNormal];
[cell addSubview:_deleteButton];
[_deleteButton addTarget:self action:@selector(deleteRecipe:) forControlEvents:UIControlEventTouchUpInside];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1154 次 |
| 最近记录: |