问题描述
我很难理解视图之间的“系统间距”或“标准间距”。
http
.authorizeRequests(authorize -> authorize
.mvcMatchers("/path/{name}").access("@webSecurity.checkName(authentication,#name)")
...
);
我注意到,如果我替换以下内容,则会有所不同:
import UIKit
import PlaygroundSupport
let rootView = UIView(frame: CGRect(x: 100,y: 100,width: 500,height: 500))
rootView.backgroundColor = .white
let containerView = UIView(frame: CGRect(origin: .zero,size: .init(width: 300,height: 200)))
containerView.backgroundColor = .yellow
rootView.addSubview(containerView)
let button = UIButton()
button.setTitle("Button",for: .normal)
button.backgroundColor = .red
containerView.addSubview(button)
button.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
button.widthAnchor.constraint(equalToConstant: 100),button.leadingAnchor.constraint(equalToSystemSpacingAfter: containerView.leadingAnchor,multiplier: 1)
])
PlaygroundPage.current.needsIndefiniteExecution = true
PlaygroundPage.current.liveView = rootView
在按钮位置button.leadingAnchor.constraint(equalTo: containerView.leadingAnchor)
的。另外,equalToSystemSpacingAfter
如何适应文本大小的变化?