我有一个像这样的UITextField:
lazy var mailTextField: UITextField = {
let textField = UITextField(forAutoLayout: ())
textField.delegate = self
let leftImgView = UIImageView(image: UIImage(named: "dd"))
leftImgView.frame = CGRectMake(0.0, 0.0, leftImgView.image!.size.width + 22.0, leftImgView.image!.size.height);
leftImgView.contentMode = .Center
textField.leftView = leftImgView
textField.leftViewMode = .Always
textField.layer.borderColor = UIColor.sweet().CGColor
textField.layer.borderWidth = 1
textField.layer.masksToBounds = true
textField.autocorrectionType = .No
textField.autocapitalizationType = .None
textField.spellCheckingType = .No
return textField
}()
这给了我这个结果:
如果你仔细观察,你会看到左边和底边线较粗。这怎么可能?我告诉边界需要1厚。
有没有办法在顶部和右边有一个1的边框,然后是整个视图?
答案 0 :(得分:1)
我认为这是模拟器规模的问题..
使您的模拟器按<ul id="tree1">
<li OnClick="Button3_Click" runat="server">
<i class='fa fa-institution' style='color: #fff;'></i>
Add Institute
<ul></ul>
</li>
<li OnClick="Button4_Click" runat="server">
<i class='fa fa-puzzle-piece' style='color: #fff;'></i>
Test
<ul></ul>
</li>
<li OnClick="Button5_Click" runat="server">
<i class='fa fa-area-chart' style='color: #fff;'></i>
Analysis
<ul></ul>
</li>
<li OnClick="Button6_Click" runat="server">
<i class='fa fa-book' style='color: #fff;'></i>
Library
<ul></ul>
</li>
<li OnClick="Button7_Click" runat="server">
<i class='fa fa-bookmark' style='color: #fff;'></i>
Bookmark
<ul></ul>
</li>
</ul>
缩放至100%或使用⌘ + 1 。这将解决您的问题。