最白目
最白目

Reputation: 3644

UIView 1px height always scales wrong in UITableViewCell

I have a custom Tableview Cell in Interfacebuilder, this is how it looks in IB:

enter image description here

Notice the thin white line under the label. This is how it's supposed to look during runtime.

The hierarchy of the UITableViewCell:

enter image description here

My problem is, during runtime of the app, the line (which is the first View under the View) scales too big, I think to about 5px height, maybe even bigger.

I tried the following after some research, but it doesn't work.

cell.line.frame =CGRectMake(161,36,282,1/[[UIScreen mainScreen] scale]);

Upvotes: 0

Views: 539

Answers (2)

tadasz
tadasz

Reputation: 4364

You should add height constrain to the line view.

Upvotes: 6

fphilipe
fphilipe

Reputation: 10054

I guess that the line is configured to scale vertically. Make sure to turn that off in IB.

Upvotes: 0

Related Questions