我使用xib文件構建了自定義tableview。我加了一個UILabel
與頂部邊框,爲頂部邊框代碼如何在iOS中使用autoresizingMask在UILabel上應用頂部邊框
UIView *topBorder = [UIView new];
topBorder.backgroundColor = [UIColor blackColor];
topBorder.frame = CGRectMake(0, 0, cell.nameOfImage.frame.size.width, 1);
[cell.nameOfImage addSubview:topBorder];
cell.nameOfImage.text = [tableData objectAtIndex:indexPath.row];
但它不能在屏幕的不同調整爲5秒和6秒加。它不顯示UILabel
大小。在5S
上邊框是不是相對於標籤顯示。
試試這個https://stackoverflow.com/questions/7666863/ uiview-bottom-border/48109396#48109396 – Datt1994