0

I am trying to set the border color of UITextField inside dynamic cell of UITableView. That's the code:

UIColor *searchBorderColor = [UIColor colorWithRed:160.0/255.0
                            green: 160.0/255.0
                            blue:160.0/255.0
                            alpha: 1.0];
cell.searchField.layer.borderColor = [searchBorderColor CGColor];

I tried putting it in cellForRowAtIndexPath, willDisplayCell, didEndDisplayingCell - it doesn't work. Please help!

4

1 に答える 1

3
cell.searchField.layer.borderWidth = 5.0f;

または他の幅の値を使用します。丸みを帯びたコーダーを追加することもできます:

cell.searchField.layer.cornerRadius = 7.0f;
于 2013-05-20T11:53:03.503 に答える